Home >Database >Mysql Tutorial >CentOS Linux下用yum 安装MySQL

CentOS Linux下用yum 安装MySQL

WBOY
WBOYOriginal
2016-06-07 17:28:321056browse

注意:CentOS Linux系统下用yum 安装MySQL,必须在网络环境下进行安装;关于Linux系统下如何连接网络,前一篇文章有介绍,请参考

注意:CentOS Linux系统下用yum 安装MySQL,必须在网络环境下进行安装;关于Linux系统下如何连接网络,前一篇文章有介绍,请参考  !

第一篇:安装和配置MySQL

第一步:安装MySQL

[root@192 local]# yum -y install mysql-server ← 安装MySQL

[root@192 local]# yum -y install php-mysql   ← 安装php-mysql

第二步:配置MySQL

[root@192 local] #vim /etc/my.cnf             ← 编辑MySQL的配置文件

[mysqld]

 datadir=/var/lib/mysql

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

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

 # clients (those using the mysqlclient10 compatibility package).

 old_passwords=1  ← 找到这一行,,在这一行的下面添加新的规则,让MySQL的默认编码为UTF-8

 default-character-set = utf8  ← 添加这一行

然后在配置文件的文尾填加如下语句:

[mysql]

 default-character-set = utf8

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn