Centos 5.5 install MySQL
yum -y install mysql-server
vi /etc/my.cnf
--
[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
default-character-set = utf8
[mysql.server]
user=mysql
basedir=/var/lib
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[mysql]
default-character-set = utf8
--
chkconfig mysqld on
chkconfig --list mysqld
2-5 開啟
/etc/rc.d/init.d/mysqld start
--
正在初始化 MySQL 資料庫: Neither host 'ip位置' nor 'localhost' could be looked up with
/usr/bin/resolveip
Please configure the 'hostname' command to return a correct hostname.
If you want to solve this at a later stage, restart this script with
the --force option
--
vi /etc/hosts
--
# Do not remove the following line, or various programs
# that require network functionality will fail.
#::1 localhost.localdomain localhost
127.0.0.1 localhost.localdomain localhost
--
/etc/rc.d/init.d/mysqld start
mysqladmin -u root password 'Your Password'