ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
最近装的Linux系统上想跑mysql,发现以上问题服务没有开,用root权限执行service mysqld start
有如下信息:
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
告诉你用以上命令行设置root用户的密码。
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
另外还提示可以运行/usr/bin/mysql_secure_installation安全配置
进行更多的配置选项,可以让你删除掉创建好的test数据库及防止匿名用户登录
,正式环境中就建议这样做的。
linux下命令提示还是很不错,留下学习印记。