ubuntu 14.04 安装mysql_ubuntu14.04安装mysql

下载

MySQL-5.6.23-1.linux_glibc2.5.x86_64.rpm-bundle.tar

解压

MySQL-client-5.6.23-1.linux_glibc2.5.x86_64.rpm

MySQL-devel-5.6.23-1.linux_glibc2.5.x86_64.rpm

MySQL-embedded-5.6.23-1.linux_glibc2.5.x86_64.rpm

MySQL-server-5.6.23-1.linux_glibc2.5.x86_64.rpm

MySQL-shared-5.6.23-1.linux_glibc2.5.x86_64.rpm

MySQL-shared-compat-5.6.23-1.linux_glibc2.5.x86_64.rpm

MySQL-test-5.6.23-1.linux_glibc2.5.x86_64.rpm

转换成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;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值