Last active
August 29, 2015 14:19
-
-
Save yudapc/d251c3e30b1915cef47c to your computer and use it in GitHub Desktop.
Mysql Ubuntu 14.04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE USER 'userbaru'@'localhost' IDENTIFIED BY 'password_disini'; | |
GRANT ALL PRIVILEGES ON namadatabase.* To 'userbaru'@'localhost' IDENTIFIED BY 'password_disini'; | |
change password user: | |
use mysql; | |
update user set password=PASSWORD('your_new_password') where User='root'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Backup one database | |
mysqldump -u namauser -p namadatabase > namafile.sql | |
Backup one database and one table | |
mysqldump -u namauser -p namadatabase tablename > tablename.sql | |
Backup ALL: | |
mysqldump --lock-all-tables -u root -p --all-databases > dump.sql | |
Restore: | |
mysql -u root -p < dump.sql | |
Restart service: | |
sudo service mysql restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install: | |
sudo apt-get install phpmyadmin | |
sudo ln -s /usr/share/phpmyadmin /usr/share/nginx/html | |
sudo php5enmod mcrypt | |
sudo service php5-fpm restart | |
test to access: http://server_domain_or_IP/phpmyadmin | |
more scure: | |
1. generate password using this command: | |
$ openssl passwd | |
2. copy encripted password for example O5az.RSPzd.HE | |
3. create account: | |
$ sudo nano /etc/nginx/pma_pass | |
username:O5az.RSPzd.HE | |
4. configure in site-available: | |
location /phpmyadmin { | |
auth_basic "Admin Login"; | |
auth_basic_user_file /etc/nginx/pma_pass; | |
} | |
5. Restart nginx: | |
$ sudo service nginx restart | |
6. Try to access: http://server_domain_or_IP/phpmyadmin | |
if there is login form your configuration is true | |
Logout from phpmyadmin: | |
/index.php?old_usr=whateve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo deluser mysql | |
sudo delgroup mysql | |
sudo service mysql stop #or mysqld | |
sudo killall -9 mysql | |
sudo killall -9 mysqld | |
sudo apt-get remove --purge mysql-server mysql-client mysql-common | |
sudo apt-get autoremove | |
sudo apt-get autoclean | |
sudo deluser mysql | |
sudo rm -rf /var/lib/mysql | |
sudo apt-get purge mysql-server-core-5.5 | |
sudo apt-get purge mysql-client-core-5.5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment