===============================================================================
输入ps -ef|grep mysqld
查看mysqld是否有运行。
没有运行执行service mysqld start
启动mysql
初始情况mysql root用户没有设置密码,输入mysql
可直接连接。
连接mysql后输入如下语句为root设置密码:
ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘密码’;
quit
退出后,输入mysql -u root -p
,回车输入密码即可连接mysql。
service mysqld stop
可停止mysql。
service mysqld restart
重启mysql。
==============================================================================
连接mysql输入grant all privileges on *.* to 'stefan'@'%' identified by '123456' with grant option;
,但是报了语法错误:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your M