下载mysql
MySQL-5.6.23-1.linux_glibc2.5.x86_64.rpm-bundle.tarlinux
解压sql
MySQL-client-5.6.23-1.linux_glibc2.5.x86_64.rpm数据库
MySQL-devel-5.6.23-1.linux_glibc2.5.x86_64.rpmsocket
MySQL-embedded-5.6.23-1.linux_glibc2.5.x86_64.rpmui
MySQL-server-5.6.23-1.linux_glibc2.5.x86_64.rpmserver
MySQL-shared-5.6.23-1.linux_glibc2.5.x86_64.rpmip
MySQL-shared-compat-5.6.23-1.linux_glibc2.5.x86_64.rpmget
MySQL-test-5.6.23-1.linux_glibc2.5.x86_64.rpmhash
转换成deb
sudo apt-get install alien
fakeroot alien MySQL-client-5.6.23-1.linux_glibc2.5.x86_64.rpm
依次转换全部rpm包
增长用户组
groupadd mysql
增长用户
useradd -r -g mysql mysql
安装mysql
sudo dpkg -i mysql-*.deb
mysql_install_db --user=mysql 导入数据库
配置/etc/my.cnf配置文件
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql.sock
default-character-set=utf8
# The MySQL server
[mysqld]
character-set-server=utf8
language=/usr/share/mysql/english/
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-name-resolve
#skip-locking
max_connect_errors=1000
max_connections=1000
max_allowed_packet = 10M
key_buffer = 128M
sort_buffer_size = 64M
net_buffer_length = 128K
read_buffer_size = 128M
read_rnd_buffer_size = 128M
myisam_sort_buffer_size = 128M
key_buffer_size=128M
table_open_cache=128
thread_cache_size=64
query_cache_size=200M
query_cache_limit=200M
table_definition_cache=128
myisam_data_pointer_size=7
delayed_queue_size=256
preload_buffer_size=65536
delayed_queue_size=20
preload_buffer_size=1024
innodb_read_ahead_threshold=2
innodb_buffer_pool_size=128M;
innodb_additional_mem_pool=16M;
thread_concurrency = 2
#skip-locking
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
配置完毕
启动mysql服务
service mysql start
安装libaio1
sudo apt-get install libaio1
配置mysql密码
mysqladmin -u root password "root123"
使用用户名密码登录
mysql -u root -p
分配权限,容许任何人以任何地址使用该用户名及密码登录mysql server
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root123' WITH GRANT OPTION;
提交
flush privileges;