memoryboxes blog

Been here so long got to calling it home.

Mysql Cheat

| Comments

整理一下经常忘记的mysql命令

连接

1
$ mysql -u root -p

list

1
2
$ show DATABASES;
$ show TABLES;

Error

  • ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)
1
2
3
4
$ mysqld --skip-grant-tables
$ mysql -u root mysql
$ mysql> UPDATE user SET Password=PASSWORD('my_password') where USER='root';
$ mysql> FLUSH PRIVILEGES;

Comments