`

Linux安装MySQL

阅读更多

安装mysql

yum install mysql-server

 

创建mysql.pid文件

vim /var/run/mysqld/mysqld.pid

 

启动mysql

service mysqld start

 

设置系统自动启动mysqld

chkconfig mysqld on

chkconfig –list mysqld

 

复制配置文件

cp /usr/share/mysql/my-medium.cnf /etc/my.cnf

 

root帐号设置密码:

mysqladmin -u root password '123456'

 

修改数据库编码,支持中文

[root@my_nn_01 ~]# vim /etc/my.cnf

[mysqld]

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

user=mysql

# Default to using old password format for compatibility with mysql 3.x

# clients (those using the mysqlclient10 compatibility package).

old_passwords=1

default-character-set=utf8

# Disabling symbolic-links is recommended to prevent assorted security risks;

# to do so, uncomment this line:

# symbolic-links=0

 

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

[mysql]

default-character-set=utf8

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics