- linux yum安装mysql后要注意的一些初始化问题
发布时间:2011-08-03 类别:linux技术 来源:侠客工作室 -
- 1
- 2
- 3
- 4
- 5
1. 配置开机启动服务
/sbin/chkconfig httpd on [设置apache服务器httpd服务开机启动]
/sbin/chkconfig –add mysqld [在服务清单中添加mysql服务]
/sbin/chkconfig mysqld on [设置mysql服务开机启动]
/sbin/service httpd start [启动httpd服务,与开机启动无关]
/sbin/service mysqld start [启动mysql服务,与开机无关]2. 设置mysql数据库root帐号密码。默认的初始化密码为空~~~
mysqladmin -u root password ‘new-password’ [引号内填密码]3. 让mysql数据库更安全
mysql -u root -p
mysql> DROP DATABASE test; [删除test数据库]
mysql> DELETE FROM mysql.user WHERE user = ”; [删除匿名帐户]
mysql> FLUSH PRIVILEGES; [重载权限]
4.安装上mysql扩展
yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql
5.设置默认编码等一些初始参数(my.cnf)
vi /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
[client]
default-character-set=utf8 [添加]
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid- ☆☆☆技术交流群:5684178☆☆☆
- 上一篇:Centos中yum安装和卸载软件的使用方法
- 下一篇:用yum安装Apache,Mysql,PHP,phpMyAdmin