ITPub博客

首页 > 数据库 > Oracle > 【MySQL】Linux 5.1操作系统安装成功之后配置MySQL数据库过程

【MySQL】Linux 5.1操作系统安装成功之后配置MySQL数据库过程

原创 Oracle 作者:OCMU联盟 时间:2009-06-24 18:28:34 0 删除 编辑
博文目的:安装完Linux操作系统后,明明在安装过程中选择了MySQL组件,但是怎么就是进入不到MySQL数据库中呢?OK,普及工作开始。
这里我最新安装的操作系统版本为:
[root@testdb ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.1 (Tikanga)

1.拷贝 my.cnf
[root@testdb ~]# cp /usr/share/doc/mysql-server-5.0.22/my-medium.cnf /etc/my.cnf

2.初始化数据库
/usr/bin/mysql_install_db --user=mysql

3.启动 MySQL 服务
/usr/bin/mysqld_safe --user=mysql &

4.停止 MySQL 服务
/usr/bin/mysqladmin shutdown

5.设置 MySQL 服务开机自启动
# cp mysql.server /etc/rc.d/init.d/mysqld
设置使mysql每次启动都能自动运行
# chkconfig --add mysqld
# chkconfig --level 345 mysqld on
通过 service mysql start | stop | restart 管理 mysql 服务
# service mysqld start   //启动mysqld服务
# service mysqld stop    //停止mysqld服务
# service mysqld restart //重启mysqld服务

6.能够进入到MySQL数据库啦!
[root@testdb ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 5.0.22-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

-- The End --

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/70034820/viewspace-2994277/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
OCM联盟( Oracle Certified Master Union)是由侯圣文(ACE总监)发起的一个公益组织,旨在为每一个OCM大师提供一个可以继续展示自己才华,技术和实力的平台。

注册时间:2007-05-27

  • 博文量
    799
  • 访问量
    8407006