1.系统服务的方式启动
systemctl stop mysql
systemctl start mysql
systemctl status mysql
[root@localhost ~]# more /usr/lib/systemd/system/mysql.service
[Unit]
Description=MySQL Server
Documentation=man:mysqld(8)
Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html
After=network.target
After=syslog.target
[Install]
WantedBy=multi-user.target
[Service]
User=mysql
Group=mysql
ExecStart=/home/mysql57/bin/mysqld_safe --defaults-file=/home/mysql57/conf/my.cnf --user=mysql
##LimitNOFILE = 5000
#Restart=on-failure
#RestartPreventExitStatus=1
#PrivateTmp=false
mysql> select @@open_files_limit,@@table_open_cache,@@max_connections,@@table_definition_cache;
+--------------------+--------------------+-------------------+--------------------------+
| @@open_files_limit | @@table_open_cache | @@max_connections | @@table_definition_cache |
+--------------------+--------------------+-------------------+--------------------------+
| 1024 | 400 | 214 | 600 |
+--------------------+--------------------+-------------------+--------------------------+
1 row in set (0.00 sec)
2.使用手工启动的方式(mysql账号启动)
/home/mysql57/bin/mysqld_safe --defaults-file=/home/mysql57/conf/my.cnf --user=mysql &
mysql> select @@open_files_limit,@@table_open_cache,@@max_connections,@@table_definition_cache;
+--------------------+--------------------+-------------------+--------------------------+
| @@open_files_limit | @@table_open_cache | @@max_connections | @@table_definition_cache |
+--------------------+--------------------+-------------------+--------------------------+
| 65536 | 2000 | 10000 | 1400 |
+--------------------+--------------------+-------------------+--------------------------+
1 row in set (0.00 sec)