案例一:
启动:/usr/local/mysql/bin/mysqld --defaults-file=/user/zzp/app/5629/iN/330N.cnf & 注意###
启动报错Starting MySQL...The server quit without updating PID file
解决: vim /etc/init.d/mysql 进去
搜索报错结果:The server quit without updating PID file
!!! 查看basedir =
datadir =
<在配置文件my.cnf中>
报错:Please read "Security" section of the manual to find out how to run mysqld as root!
请阅读安全手册 不能直接使用root登录
解决: 1、 进入/etc/my.cnf
在[mysqld]
下添加 user=mysql
2、在启动命令后面 加--user=mysql 强制启动
报错: [root@xiaoxiao /]# /user/zzp/app/5629/A/scripts/mysql_install_db --defaults-file=/user/zzp/app/5629/i1/3307.cnf --user=mysql
FATAL ERROR: Could not find ./bin/my_print_defaults
If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.
If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.
解决:启动命令 和 初始化命令混淆:
初始化命令:/****/scripts/mysql_install_db --basedir=/** --datadir=/** --user=mysql
启动命令: /****/mysqld --defaults-file=/user/***/***.cnf &
#建议配置文件的文件名为 ***.cnf 格式
案例二:
[root@xiaoxiao mysql]# /usr/local/mysql/bin/mysqld --defaults-file=/user/zzp/app/5629/i4/3310.cnf --user=mysql &
[1] 1670
[root@xiaoxiao mysql]# 2017-01-06 02:53:41 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-01-06 02:53:41 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.6.29) starting as process 1670 ...
2017-01-06 02:53:41 1670 [ERROR] Can't find messagefile '/user/zzp/app/5269/A/share/errmsg.sys'
2017-01-06 02:53:41 1670 [Warning] Can't create test file /user/zzp/app/5269/i4/xiaoxiao.lower-test
2017-01-06 02:53:41 1670 [Warning] Can't create test file /user/zzp/app/5269/i4/xiaoxiao.lower-test
/usr/local/mysql/bin/mysqld: Can't change dir to '/user/zzp/app/5269/i4/' (Errcode: 2 - No such file or directory)
2017-01-06 02:53:41 1670 [ERROR] Aborting
2017-01-06 02:53:41 1670 [Note] Binlog end
2017-01-06 02:53:41 1670 [Note]
[1]+ Exit 1 /usr/local/mysql/bin/mysqld --defaults-file=/user/zzp/app/5629/i4/3310.cnf --user=mysql
解决: 在3310.cnf 中把5629 错打成5269 (细心才行呀!!)