Heim  >  Artikel  >  Datenbank  >  MySQL常用命令_MySQL

MySQL常用命令_MySQL

WBOY
WBOYOriginal
2016-05-27 14:29:44997Durchsuche

bitsCN.com

1. 备份数据库

mysqldump -uroot -p test_db > test_db.sql

 

2. 恢复数据库

mysql -uroot -p test_db

 

3. 创建权限

 

grant all privileges on test_db.* to test_db@'localhost' identified by '123456';

兼容mysql4.1之前模式:
update mysql.user set password=old_password('123456')  where user='test_db';

 

4. 忘记密码

在“my.cnf”或“my.ini”文件的“mysqld”配置段添加“skip-grant-tables”,然后重新启动mysql即可登录修改root密码。

 

bitsCN.com
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn