ubuntu mysql5.6安装

转载请注明出处:http://feuyeux.iteye.com/blog/1911556

 

下载

http://dev.mysql.com/doc/refman/5.6/en/linux-installation-debian.html

监控旧版本
sudo netstat -tap | grep mysql

whereis mysql
mysql: /usr/bin/mysql /etc/mysql /usr/lib/mysql /usr/bin/X11/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz

ls /etc/mysql
conf.d  debian.cnf  debian-start  my.cnf

ls /usr/lib/mysql
plugin

ls /usr/share/mysql
charsets           debian-start.inc.sh  fill_help_tables.sql  japanese                      ndb-config-2-node.ini  russian
config.huge.ini    dutch                french                korean                        norwegian              serbian
config.medium.ini  echo_stderr          german                mysqld_multi.server           norwegian-ny           slovak
config.small.ini   english              greek                 mysql_system_tables_data.sql  polish                 spanish
czech              errmsg-utf8.txt      hungarian             mysql_system_tables.sql       portuguese             swedish
danish             estonian             italian               mysql_test_data_timezone.sql  romanian               ukrainian
卸载旧版本
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
安装
sudo apt-get install libaio-dev
sudo dpkg -i mysql-5.6.15-debian6.0-x86_64.deb
配置

http://dev.mysql.com/doc/refman/5.6/en/binary-installation.html

sudo groupadd mysql
sudo useradd -r -g mysql mysql
cd /opt/mysql/server-5.6/
sudo mkdir data
sudo chown mysql:mysql data
sudo mkdir log
sudo chown mysql:mysql log

sudo cp /opt/mysql/server-5.6/share/english/errmsg.sys /usr/share/mysql/errmsg.sys
sudo chown mysql:mysql /usr/share/mysql/errmsg.sys

sudo scripts/mysql_install_db --user=mysql --no-defaults
sudo cp support-files/my-default.cnf /etc/mysql/my.cnf
sudo cp support-files/mysql.server /etc/init.d/mysql.server
sudo cp support-files/mysql-log-rotate /etc/logrotate.d/mysql.server

sudo nano /etc/mysql/my.cnf

[client]
port            = 3306
socket          = /tmp/mysql56.sock

[mysqld_safe]
port            = 3306
socket          = /tmp/mysql56.sock
nice            = 0

[mysqld]
user            = mysql
pid-file        = /tmp/mysql56.pid
port            = 3306
socket          = /tmp/mysql56.sock

basedir         = /opt/mysql/server-5.6
datadir         = /opt/mysql/server-5.6/data
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
#bind-address           = 127.0.0.1

key_buffer              = 16M
max_allowed_packet      = 16M
thread_stack            = 192K
thread_cache_size       = 8
myisam-recover         = BACKUP
query_cache_limit       = 1M
query_cache_size        = 16M
log_error= /opt/mysql/server-5.6/log/error.log
expire_logs_days        = 10
max_binlog_size         = 100M

[mysqldump]
quick
quote-names
max_allowed_packet      = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer              = 16M

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
启动

 

sudo service mysql.server start

mysqladmin -u root password 'root'
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值