标签:sudo mysql 数据 如何 pid mysqld port pretty 显示
1.检查MySQL服务器是否启动
ps -ef | grep mysqld
如何显示如下,证明已经启动
localhost:~ mhx$ ps -ef | grep mysqld
0 1053 1 0 9:59上午 ttys000 0:00.03 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/localhost.pid
74 1171 1053 0 9:59上午 ttys000 0:00.48 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/localhost.err --pid-file=/usr/local/mysql/data/localhost.pid
501 1242 1235 0 10:07上午 ttys001 0:00.00 grep mysqld
2.启动mysql服务器
localhost:~ mhx$ cd /usr/local/mysql/support-files/
localhost:support-files mhx$ sudo ./mysql.server start
3.登陆数据
localhost:support-files mhx$ cd /usr/local/mysql/bin/
localhost:bin mhx$ ./mysql -u root -p
3.查看数据库
mysql> show databases;
标签:sudo mysql 数据 如何 pid mysqld port pretty 显示
原文地址:https://www.cnblogs.com/code4app/p/9154882.html