一、安装方法
二、常用命令
1.启动:/etc/init.d/mysql start
2.停止:/etc/init.d/mysql stop
3.重启:/etc/init.d/mysql restart
三、报错
1、Can't connect to MySQL server on '<remote-ip>' (61)
第一次安装可能是3306 只监听了localhost ,修改配置文件/etc/mysql/mysql.conf.d/mysqld.cnf中的bind-address为0.0.0.0即可
2、权限不够
(1)SSH登录root管理员账户
(2)登录MySql
mysql -u root -p
Enter password:
(3)执行授权命令
mysql> grant all privileges on *.* to root@'localhost' identified by '密码';
mysql> flush privileges;
或
mysql> grant all privileges on *.* to root@'%' identified by '密码';
mysql> flush privileges;
(4)退出再试
mysql> quit
Bye
(5)再次登录
四、 supervisor 配置(可不用配置 默认后台自启动)
[program:mysql_3306]
command=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid
process_name=mysql_3306
numprocs=1
;user=martin
autostart=true
autorestart=true
startsecs=10
startretries=7
stopsignal=TERM
stopwaitsecs=60
redirect_stderr=false
stdout_logfile=/root/log/mysql/mysql.log
stdout_logfile_maxbytes=50MB
stdout_logfile_backups=10
stdout_capture_maxbytes=1MB
stderr_logfile=/root/log/mysql/mysql_error.log
stderr_logfile_maxbytes=50MB
stderr_logfile_backups=10
stderr_capture_maxbytes=1MB
;directory=/home/martin/data/logagent
serverurl=AUTO
网友评论