This page looks best with JavaScript enabled

Some Common MySQL Commands

 ·  ☕ 1 min read

1. Passwordless Login

  1. Edit /etc/my.cnf and add a line under [mysqld]:
skip-grant-tables=1
  1. Restart the mysqld service
1
systemctl restart mysqld
  1. Log in to MySQL as the root user
1
mysql -u root

2. Allow All Access Sources

  1. Log in to MySQL
1
mysql -u root -p

At the MySQL interactive command line, enter:

1
2
3
4
USE mysql;
SELECT user, host FROM user;
update user set host = '%' where user = 'root';
FLUSH PRIVILEGES;

3. Export All Data

1
mysqldump -uroot -proot --all-databases >/tmp/all.sql

WeChat Official Account
WRITTEN BY
WeChat Official Account