wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.39.tar.gz wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.39.tar.gz 【解压到你指定的目录,我这里选择 /data/server/ 】 tar zxvf mysql-5.6.39.tar.gz -C /data/server/ mv mysql-5.6.39 mysql cd mysql
which will also give you the optionof removing the test databasesand anonymous user created by default. This is strongly recommended for production servers. See the manualfor more instructions. You can start the MySQL daemon with:
cd . ; /data/server/mysql/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl cd mysql-test ; perl mysql-test-run.pl Please report any problems at http://bugs.mysql.com/ The latest information about MySQL is available on the web at http://www.mysql.com Support MySQL by buying support/licenses at http://shop.mysql.com New default config file was created as /data/server/mysql/my.cnf and will be used by default by the server when you start it. You may edit this filetochangeserversettings
输出: root@ubuntu:/data/server/mysql/bin# mysql --help|grep'my.cnf' /etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf order of preference, my.cnf, $MYSQL_TCP_PORT, root@ubuntu:/data/server/mysql/bin#
//////////////////或者///////////////// ./bin/mysqld --verbose --help |grep -A 1'Default options'
输出: root@ubuntu:/data/server/mysql# ./bin/mysqld --verbose --help |grep -A 1'Default options' 2018-04-0801:55:320 [Note] --secure-file-priv issetto NULL. Operations related to importing and exporting data are disabled 2018-04-0801:55:320 [Note] ./bin/mysqld (mysqld 5.6.39) starting as process 34387 ... 2018-04-0801:55:3234387 [Note] Plugin 'FEDERATED'is disabled. Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf /data/server/mysql/etc/my.cnf ~/.my.cnf 2018-04-0801:55:3234387 [Note] Binlog end 2018-04-0801:55:3234387 [Note] Shutting down plugin 'CSV' 2018-04-0801:55:3234387 [Note] Shutting down plugin 'MyISAM' root@ubuntu:/data/server/mysql#
修改 my.cnf 文件指定错误日志位置 log_error=/data/mysql.log 错误日志默认存放位置为数据目录下,你也可以用下面命令查看: SHOW GLOBAL VARIABLES LIKE '%log_error%'; mysql> SHOW GLOBAL VARIABLES LIKE '%log_error%'; +---------------------+-----------------+ | Variable_name | Value | +---------------------+-----------------+ | binlog_error_action | IGNORE_ERROR | | log_error | /data/mysql.log | +---------------------+-----------------+ 2 rows in set (0.00 sec)