Database

From wiki
Revision as of 23:17, 18 October 2013 by Administrator (talk | contribs) (Created page with "==Resetting root password== sudo /etc/init.d/mysql stop sudo mysqld_safe --skip-grant-tables & mysql -u root use mysql; update user set password=PASSWORD("mynewpassword")...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Resetting root password

sudo /etc/init.d/mysql stop
sudo mysqld_safe --skip-grant-tables &
mysql -u root
use mysql;
update user set password=PASSWORD("mynewpassword") where User='root';
flush privileges;
quit

sudo /etc/init.d/mysql stop
...
sudo /etc/init.d/mysql start
mysql -u root -p

Export / Import

mysqldump -u root -p1234567890 my_wiki > dump.sql
mysql -u root -p1234567890 my_wiki < dump.sql