Centos5.4 安装mysql
最近老哥在万网买了一台服务器,坑人的万网,里面的配置基本为零,以前没接触过Centos ,一弄整出许多乱糟糟的事情,好记性不容烂笔头,记下供以后参考:
一: 安装apache
yum list|grep apache #列出所有的apache
yum install apache*;
二:安装php
yum list|grep php#列出所有的apache
yum install php*;
三:安装myql
yum list|grep mysql#列出所有的apache
yum install mysql*;
四:安装mysql-server
yum list|grep mysql-server #列出所有的apache
yum install mysql-server*;
/usr/bin/mysqld_safe --user=mysql&
service mysqld start;
mysqladmin -u root password 'newpassword'
设置默认编码等一些初始参数 (my.cnf)(若无my.cnf, 则可 cp /usr/share/mysql/my-small.cnf /etc/my.cnf )
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
default-character-set=utf8 [添加]
default-storage-engine=INNODB [添加]
old_passwords=1
#开启远程连接
port = 3306
bind-address = 65.55.55.2
# skip-networking
[client]
default-character-set=utf8 [添加]
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
FLUSH PRIVILEGES;