ubuntu14.04安裝mysql

下載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;

相關文章
相關標籤/搜索