温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

MYSQL服务如何安装

发布时间:2022-01-14 16:10:44 来源:亿速云 阅读:114 作者:小新 栏目:数据库

这篇文章主要介绍了MYSQL服务如何安装,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

系统环境信息
  CentOS release 6.3 (Final)
  VMware? Workstation 9.0.0 build-812388
  rpm安装包准备
  1 从光盘拷贝如下安装包到指定目录
  2 也可以从RPM资源网站下载到本地环境
  perl-DBI-1.609-4.el6.i686.rpm
  mysql-libs-5.1.61-4.el6.i686.rpm
  mysql-5.1.61-4.el6.i686.rpm
  perl-DBD-MySQL-4.013-3.el6.i686.rpm
  mysql-server-5.1.61-4.el6.i686.rpm
  目录名称
  /usr/dev/mysql
  卸除原有MYSQL服务
  操作步骤
  #cd /usr/dev
  #rpm -ivh perl-DBI-1.609-4.el6.i686.rpm
  #rpm -ivh mysql-libs-5.1.61-4.el6.i686.rpm
  #rpm -ivh mysql-5.1.61-4.el6.i686.rpm
  #rpm -ivh perl-DBD-MySQL-4.013-3.el6.i686.rpm
  #rpm -ivh mysql-server-5.1.61-4.el6.i686.rpm
  #/usr/bin/mysql_install_db --user=mysql
  #/usr/bin/mysqld_safe &
  #/etc/init.d/mysqld status
  备注
  命令7含义 初始化MYSQL数据库 该命令用来初始化 mysql数据库,即创建/var/lib/mysql目录
  命令8含义 启动MYSQL服务
  命令9含义 查看MYSQL启动状态
  执行命令7后显示如下信息
  ========================================================
  Installing MySQL system tables...
  OK
  Filling help tables...
  OK
  To start mysqld at boot time you have to copy
  support-files/mysql.server to the right place for your system
  PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
  To do so, start the server, then issue the following commands:
  /usr/bin/mysqladmin -u root password 'new-password'
  /usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
  Alternatively you can run:
  /usr/bin/mysql_secure_installation
  which will also give you the option of removing the test
  databases and anonymous user created by default.  This is
  strongly recommended for production servers.
  See the manual for more instructions.
  You can start the MySQL daemon with:
  cd /usr ; /usr/bin/mysqld_safe &
  You can test the MySQL daemon with mysql-test-run.pl
  cd /usr/mysql-test ; perl mysql-test-run.pl
  Please report any problems with the /usr/bin/mysqlbug script!
  ================================================
  执行命令8后显示如下信息
  ================================================
  mysqld_safe Logging to '/var/log/mysqld.log'.
  mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
  ================================================
  执行命令9后显示如下信息
  ================================================
  mysqld (pid  4200) is running...
  ================================================

感谢你能够认真阅读完这篇文章,希望小编分享的“MYSQL服务如何安装”这篇文章对大家有帮助,同时也希望大家多多支持亿速云,关注亿速云行业资讯频道,更多相关知识等着你来学习!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI