查看mysql启动配置的方法

1、ps -ef|grep mysql

ss:mysql wqp$ ps -ef|grep mysql
  501 11054     1   0 12:27下午 ttys002    0:00.02 /bin/sh /usr/local/Cellar/mariadb/10.1.13/bin/mysqld_safe --datadir=/usr/local/var/mysql --pid-file=/usr/local/var/mysql/ss.pid
  501 11169 11054   0 12:27下午 ttys002    0:00.39 /usr/local/Cellar/mariadb/10.1.13/bin/mysqld --basedir=/usr/local/Cellar/mariadb/10.1.13 --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/mariadb/10.1.13/lib/plugin --log-error=/usr/local/var/mysql/ss.err --pid-file=/usr/local/var/mysql/ss.pid --socket=/tmp/mysql.sock --port=3306
  501 11181 10425   0 12:30下午 ttys002    0:00.00 grep mysql
  501 10214 10198   0 10:39上午 ttys004    0:00.02 mysql -uroot -px

2、show variables

SHOW VARIABLES;

3、定位my.cnf的位置查看配置

locate my.cnf;

4、mysqld --print-defaults

ss:~ wqp$ mysqld --print-defaults
mysqld would have been started with the following arguments:
--port=3306 --socket=/tmp/mysql.sock --skip-external-locking --key_buffer_size=16M --max_allowed_packet=1M --table_open_cache=64 --sort_buffer_size=512K --net_buffer_length=8K --read_buffer_size=256K --read_rnd_buffer_size=512K --myisam_sort_buffer_size=8M --log-bin=mysql-bin --binlog_format=mixed --server-id=1

你可能感兴趣的:(查看mysql启动配置的方法)