创建密码:
cmd下切换到 mysql 安装目录
例
d:/mysql/bin
前提:mysql用户root密码为空.
输入 mysql -u root mysql
mysql> 状态下输入 update user set password=password('新密码') where user='root';
回显
Query OK, 0 rows affected (0.00 sec)
Rows matched: 2 Changed: 0 Warnings: 0
mysql> 状态下输入 FLUSH PRIVILEGES;
回显
Query OK, 0 rows affected (0.00 sec)
mysql> 状态下输入 quit
退出 sql
以前没有密码可以连接,可是我按上面的方法后,改了密码就连接不了?
帮忙啊。。
cmd下切换到 mysql 安装目录
例
d:/mysql/bin
前提:mysql用户root密码为空.
输入 mysql -u root mysql
mysql> 状态下输入 update user set password=password('新密码') where user='root';
回显
Query OK, 0 rows affected (0.00 sec)
Rows matched: 2 Changed: 0 Warnings: 0
mysql> 状态下输入 FLUSH PRIVILEGES;
回显
Query OK, 0 rows affected (0.00 sec)
mysql> 状态下输入 quit
退出 sql
以前没有密码可以连接,可是我按上面的方法后,改了密码就连接不了?
帮忙啊。。
这样也不对?
在[mysqld]的段中加上一句:skip-grant-tables