sudo apt-get update
sudo apt-get upgrade
Apt-get Install Libaio1
(Apt-get install Mysql-server mysql-client automatic installation will be mounted on 5.7)
sudo groupadd MySQL
sudo useradd-r-g MySQL MySQL
Cd/usr/local/src
sudo wget Mysql-server_5.7.15-1ubuntu16.04_amd64.deb-bundle.tar
Http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-server_5.7.15-1ubuntu16.04_amd64.deb-bundle.tar
sudo tar-xvf Mysql-server_5.7.15-1ubuntu16.04_amd64.deb-bundle.tar
sudo dpkg-i mysql-common_5.7.15-1ubuntu16.04_amd64.deb
sudo dpkg-preconfigure mysql-community-server_5.7.15-1ubuntu16.04_amd64.deb
This step will pop up an interface that prompts you to enter the root password
sudo dpkg-i mysql-client_5.7.15-1ubuntu16.04_amd64.deb (this must be installed first, otherwise the following installation will be error-dependent missing)
sudo dpkg-i mysql-community-client_5.7.15-1ubuntu16.04_amd64.deb
< here to note: Install a libmecab2 this is to install Mysql-community-server dependencies >
sudo apt-get install LIBMECAB2
sudo dpkg-i mysql-community-server_5.7.15-1ubuntu16.04_amd64.deb
sudo dpkg-i libmysqlclient20_5.7.15-1ubuntu16.04_amd64.deb
cd/usr/local/
sudo ln-s/var/lib/mysql/usr/local/mysql
sudo mkdir/usr/local/mysql/data
sudo chown-r MySQL. /usr/local/mysql/data
Change Password
sudo/usr/bin/mysqladmin-u root-p password [optional new password (' 123456 ')]
(Two ways of password modification, refer to http://www.2cto.com/os/201412/358399.html)
Login
Sudo/usr/bin/mysql-u root-p [optional database name]
Remote connection
GRANT all privileges on * * to ' root ' @ ' 192.168.186.128 ' identified by ' 123456 ' with GRANT OPTION; --Here IP write you access to the Linux IP via SSH
Set all MySQL variables:
Set global max_connections=14000;
Open_files_limit = 10240
Back_log = 258
Max_connections = 14000
Max_connect_errors = 716
external-locking = FALSE
Max_allowed_packet = 32M
Sort_buffer_size = 8M
Join_buffer_size = 1M
Thread_cache_size = 300
Query_cache_type=1
Query_cache_size = 512M
Query_cache_limit = 2M
Query_cache_min_res_unit = 2k
Thread_stack = 192K
Tmp_table_size = 258M
Max_heap_table_size = 258M
Key_buffer_size = 512M
Read_buffer_size = 4M
Read_rnd_buffer_size = 16M
wait_timeout=1814400
Bulk_insert_buffer_size = 64M
Innodb_buffer_pool_size = 8000M
Innodb_buffer_pool_instances=32
Innodb_thread_concurrency = 8
Innodb_flush_log_at_trx_commit = 2
Innodb_log_buffer_size = 16M
Innodb_log_file_size = 2048M
Innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
Innodb_lock_wait_timeout = 120
Innodb_read_io_threads = 16
Innodb_write_io_threads = 16
Innodb_io_capacity = 20000
Innodb_io_capacity_max = 40000
To view the number of connections
Show variables like '%max_connections% '
This should be 5000, indicating that the configuration is in effect
ubuntu16.04 installation mysql5.7.15