手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

CentOS 5.8下更改MySQL的数据库目录

[日期:2012-06-23] 来源:Linux社区  作者:codingstandards [字体:大 中 小]

5. 修改 MySQL 启动脚本 /etc/init.d/mysql

原内容

# If you change base dir, you must also change datadir. These may get
# overwritten by settings in the MySQL configuration files.

basedir=
datadir= 

修改后的内容

# If you change base dir, you must also change datadir. These may get
# overwritten by settings in the MySQL configuration files.

basedir=
datadir=/disk/mysql  

6. 启动 MySQL 服务器

-bash-3.2# service mysql start 
Starting MySQL.. SUCCESS!
-bash-3.2# service mysql status
 SUCCESS! MySQL running (4874)
-bash-3.2# 

7. 测试 MySQL 访问是否正常

-bash-3.2# mysql -p
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 188
Server version: 5.5.25 MySQL Community Server (GPL)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>  

O.K.!

linux
相关资讯       MySQL教程  CentOS教程 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款