MySQL使用

来源:互联网 发布:sql server 课程 编辑:程序博客网 时间:2024/05/15 20:49

MySQL使用

启动服务net start mysql

关闭服务net stop mysql

重置MySQL密码

1、首先停止正在运行的MySQL进程

net stop mysql

2、以安全模式启动MySQL,进入bin目录

mysqld.exe –skip-grant-tables

3、完成以后就可以不用密码进入MySQL了

mysql -u root -p

4、更改密码

use mysql

update mysql.user set authentication_string=password(‘123456’) where user=’root’ and Host =’localhost’;

刷新权限(必须步骤)flush privileges;

5.退出

quit

6.杀死mysqld_safe进程,并重启mysql

net start mysql

7.登录mysql

mysql -uroot -p,之后输入密码

8.显示所有的表名

show databases;

0 0