POSTGRES TRICKS

(Notes) sudo -u postgres psql ALTER USER postgres PASSWORD ‘postgres’; CREATE USER [user_name]; ALTER USER [user_name] PASSWORT ‘[user_password]’; CREATE DATABASE [database_name]; GRANT ALL PRIVILEGES ON [database_name] TO [user_name]; ALTER USER [user_name] WITH SUPERUSER; « « sudo -u [user_name] psql -f /home/[user_name]/[dump_file_name].sql [database_name]« «  CREER UNE BASE DE DONNEES: « « createdb [database_name];« «  SUPPRIMER UNE BASE DE DONNEES: « « dropdb [database_name];« «  Afficher…

Mysql tricks

# HOW TO INSTALL MYSQL SERVICE sudo apt-get install mysql-server # HOW TO START MYSQL SERVICE sudo service mysql restart # HOW TO CONNECT TO MYSQL SERVICE sudo mysql -u [user_name] [database_name] -p # HOW TO DISCONNECT FROM MYSQL SERVICE exit # HOW TO CHANGE USER PASSWORD SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘root’); update user…