1.centos7现状:

  新系统无法再使用yum install mysql-server来安装mysql,因为已使用mariadb代替mysql。

2.安装mariadb:

  

  1. [root@localhost ~]# yum -y install mariadb*
  2. Loaded plugins: fastestmirror
  3. Loading mirror speeds from cached hostfile
  4. * base: mirrors.linode.com
  5. * extras: mirrors.linode.com
  6. * updates: mirrors.linode.com
  7. Resolving Dependencies
  8. --> Running transaction check
  9. ---> Package mariadb.x86_64 :5.5.-.el7_0 will be installed
  10. ---> Package mariadb-bench.x86_64 :5.5.-.el7_0 will be installed
  11. ---> Package mariadb-devel.x86_64 :5.5.-.el7_0 will be installed
  12. ---> Package mariadb-embedded.x86_64 :5.5.-.el7_0 will be installed
  13. ---> Package mariadb-embedded-devel.x86_64 :5.5.-.el7_0 will be installed
  14. ---> Package mariadb-libs.x86_64 :5.5.-.el7_0 will be installed
  15. ---> Package mariadb-server.x86_64 :5.5.-.el7_0 will be installed
  16. --> Processing Dependency: perl-DBD-MySQL for package: :mariadb-server-5.5.-.el7_0.x86_64
  17. ---> Package mariadb-test.x86_64 :5.5.-.el7_0 will be installed
  18. --> Running transaction check
  19. ---> Package perl-DBD-MySQL.x86_64 :4.023-.el7 will be installed
  20. --> Finished Dependency Resolution
  21.  
  22. Dependencies Resolved
  23.  
  24. ==========================================================================================================
  25. Package Arch Version Repository Size
  26. ==========================================================================================================
  27. Installing:
  28. mariadb x86_64 :5.5.-.el7_0 updates 8.9 M
  29. mariadb-bench x86_64 :5.5.-.el7_0 updates k
  30. mariadb-devel x86_64 :5.5.-.el7_0 updates k
  31. mariadb-embedded x86_64 :5.5.-.el7_0 updates 3.6 M
  32. mariadb-embedded-devel x86_64 :5.5.-.el7_0 updates 7.4 M
  33. mariadb-libs x86_64 :5.5.-.el7_0 updates k
  34. mariadb-server x86_64 :5.5.-.el7_0 updates M
  35. mariadb-test x86_64 :5.5.-.el7_0 updates 7.9 M
  36. Installing for dependencies:
  37. perl-DBD-MySQL x86_64 4.023-.el7 base k
  38.  
  39. Transaction Summary
  40. ==========================================================================================================
  41. Install Packages (+ Dependent package)
  42.  
  43. Total download size: M
  44. Installed size: M
  45. Downloading packages:
  46. (/): mariadb-bench-5.5.-.el7_0.x86_64.rpm | kB ::
  47. (/): mariadb-devel-5.5.-.el7_0.x86_64.rpm | kB ::
  48. (/): mariadb-embedded-5.5.-.el7_0.x86_64.rpm | 3.6 MB ::
  49. (/): mariadb-5.5.-.el7_0.x86_64.rpm | 8.9 MB ::
  50. (/): mariadb-libs-5.5.-.el7_0.x86_64.rpm | kB ::
  51. (/): mariadb-server-5.5.-.el7_0.x86_64.rpm | MB ::
  52. (/): mariadb-embedded-devel-5.5.-.el7_0.x86_64.rpm | 7.4 MB ::
  53. (/): mariadb-test-5.5.-.el7_0.x86_64.rpm | 7.9 MB ::
  54. (/): perl-DBD-MySQL-4.023-.el7.x86_64.rpm | kB ::
  55. ----------------------------------------------------------------------------------------------------------
  56. Total MB/s | MB ::
  57. Running transaction check
  58. Running transaction test
  59. Transaction test succeeded
  60. Running transaction
  61. Installing : :mariadb-libs-5.5.-.el7_0.x86_64 /
  62. Installing : :mariadb-5.5.-.el7_0.x86_64 /
  63. Installing : perl-DBD-MySQL-4.023-.el7.x86_64 /
  64. Installing : :mariadb-server-5.5.-.el7_0.x86_64 /
  65. Installing : :mariadb-devel-5.5.-.el7_0.x86_64 /
  66. Installing : :mariadb-embedded-5.5.-.el7_0.x86_64 /
  67. Installing : :mariadb-embedded-devel-5.5.-.el7_0.x86_64 /
  68. Installing : :mariadb-test-5.5.-.el7_0.x86_64 /
  69. Installing : :mariadb-bench-5.5.-.el7_0.x86_64 /
  70. Verifying : :mariadb-test-5.5.-.el7_0.x86_64 /
  71. Verifying : :mariadb-embedded-devel-5.5.-.el7_0.x86_64 /
  72. Verifying : :mariadb-embedded-5.5.-.el7_0.x86_64 /
  73. Verifying : :mariadb-libs-5.5.-.el7_0.x86_64 /
  74. Verifying : :mariadb-bench-5.5.-.el7_0.x86_64 /
  75. Verifying : :mariadb-5.5.-.el7_0.x86_64 /
  76. Verifying : :mariadb-server-5.5.-.el7_0.x86_64 /
  77. Verifying : perl-DBD-MySQL-4.023-.el7.x86_64 /
  78. Verifying : :mariadb-devel-5.5.-.el7_0.x86_64 /
  79.  
  80. Installed:
  81. mariadb.x86_64 :5.5.-.el7_0 mariadb-bench.x86_64 :5.5.-.el7_0
  82. mariadb-devel.x86_64 :5.5.-.el7_0 mariadb-embedded.x86_64 :5.5.-.el7_0
  83. mariadb-embedded-devel.x86_64 :5.5.-.el7_0 mariadb-libs.x86_64 :5.5.-.el7_0
  84. mariadb-server.x86_64 :5.5.-.el7_0 mariadb-test.x86_64 :5.5.-.el7_0
  85.  
  86. Dependency Installed:
  87. perl-DBD-MySQL.x86_64 :4.023-.el7
  88.  
  89. Complete!
  90. [root@localhost ~]# systemctl start mariadb.service
  91. [root@localhost ~]# systemctl enable mariadb.service
  92. ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.servi
  93. ce'
  94. [root@localhost ~]# mysql
  95. Welcome to the MariaDB monitor. Commands end with ; or \g.
  96. Your MariaDB connection id is
  97. Server version: 5.5.-MariaDB MariaDB Server
  98.  
  99. Copyright (c) , , Oracle, Monty Program Ab and others.
  100.  
  101. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  102.  
  103. MariaDB [(none)]> logout
  104. -> exit
  105. ->
  106. -> ;
  107. ERROR (): You have an error in your SQL syntax; check the manual that corresponds to your MariaD
  108. B server version for the right syntax to use near 'logout
  109. exit' at line 1
  110. MariaDB [(none)]> exit
  111. Bye
  112. [root@localhost ~]# systemctl enable mariadb.service
  113. [root@localhost ~]# mysql
  114. Welcome to the MariaDB monitor. Commands end with ; or \g.
  115. Your MariaDB connection id is
  116. Server version: 5.5.-MariaDB MariaDB Server
  117.  
  118. Copyright (c) , , Oracle, Monty Program Ab and others.
  119.  
  120. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  121.  
  122. MariaDB [(none)]> show databases;
  123. +--------------------+
  124. | Database |
  125. +--------------------+
  126. | information_schema |
  127. | mysql |
  128. | performance_schema |
  129. | test |
  130. +--------------------+
  131. rows in set (0.00 sec)
  132.  
  133. MariaDB [(none)]> use test
  134. Database changed
  135. MariaDB [test]> show tables;
  136. Empty set (0.00 sec)
  137.  
  138. MariaDB [test]> exit
  139. Bye
  140. [root@localhost ~]# mysql_secure_installation
  141. /usr/bin/mysql_secure_installation: line : find_mysql_client: command not found
  142.  
  143. NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
  144. SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
  145.  
  146. In order to log into MariaDB to secure it, we'll need the current
  147. password for the root user. If you've just installed MariaDB, and
  148. you haven't set the root password yet, the password will be blank,
  149. so you should just press enter here.
  150.  
  151. ERROR (): Access denied for user 'root'@'localhost' (using password: YES)
  152. Enter current password for root (enter for none):
  153. OK, successfully used password, moving on...
  154.  
  155. Setting the root password ensures that nobody can log into the MariaDB
  156. root user without the proper authorisation.
  157.  
  158. Set root password? [Y/n] y
  159. New password:
  160. Re-enter new password:
  161. Password updated successfully!
  162. Reloading privilege tables..
  163. ... Success!
  164.  
  165. By default, a MariaDB installation has an anonymous user, allowing anyone
  166. to log into MariaDB without having to have a user account created for
  167. them. This is intended only for testing, and to make the installation
  168. go a bit smoother. You should remove them before moving into a
  169. production environment.
  170.  
  171. Remove anonymous users? [Y/n] y
  172. ... Success!
  173.  
  174. Normally, root should only be allowed to connect from 'localhost'. This
  175. ensures that someone cannot guess at the root password from the network.
  176.  
  177. Disallow root login remotely? [Y/n] y
  178. ... Success!
  179.  
  180. By default, MariaDB comes with a database named 'test' that anyone can
  181. access. This is also intended only for testing, and should be removed
  182. before moving into a production environment.
  183.  
  184. Remove test database and access to it? [Y/n] y
  185. - Dropping test database...
  186. ... Success!
  187. - Removing privileges on test database...
  188. ... Success!
  189.  
  190. Reloading the privilege tables will ensure that all changes made so far
  191. will take effect immediately.
  192.  
  193. Reload privilege tables now? [Y/n] y
  194. ... Success!
  195.  
  196. Cleaning up...
  197.  
  198. All done! If you've completed all of the above steps, your MariaDB
  199. installation should now be secure.
  200.  
  201. Thanks for using MariaDB!
  202. [root@localhost ~]# mysql -uroot -p
  203. Enter password:
  204. Welcome to the MariaDB monitor. Commands end with ; or \g.
  205. Your MariaDB connection id is
  206. Server version: 5.5.-MariaDB MariaDB Server
  207.  
  208. Copyright (c) , , Oracle, Monty Program Ab and others.
  209.  
  210. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  211.  
  212. MariaDB [(none)]> show databases;
  213. +--------------------+
  214. | Database |
  215. +--------------------+
  216. | information_schema |
  217. | mysql |
  218. | performance_schema |
  219. | zbphp.com |
  220. +--------------------+
  221. rows in set (0.00 sec)
  222.  
  223. MariaDB [(none)]>

centos7安装mysql(MariaDB)的更多相关文章

  1. centos7安装mysql mariadb

    从最新版本的linux系统开始,默认的是 Mariadb而不是mysql! 使用系统自带的repos安装很简单: yum install -y mariadb mariadb-server 启动mar ...

  2. CentOS7安装mysql提示“No package mysql-server available.”

    针对centos7安装mysql,提示"No package mysql-server available."错误,解决方法如下: Centos 7 comes with Mari ...

  3. [CentOs7]安装mysql(2)

    摘要 之前安装过一次mysql,最后配置,发现在本地无法连接,重启服务的时候一直卡在那里不动,感觉是安装的过程出问题,最后没办法还是卸载了,然后重新安装一下. [CentOs7]安装mysql Mys ...

  4. Linux - centos7 下 MySQL(mariadb) 和 主从复制

    目录 Linux - centos7 下 MySQL(mariadb) 和 主从复制 MySQL(mariadb) 安装MySQL(mariadb) 配置数据库的中文支持 在远程用 mysql客户端去 ...

  5. centos7安装Mysql爬坑记录

    centos7安装Mysql爬坑记录   查看是否已安装 使用下列命令查看是否已经安装过mysql/mariadb/PostgreSQL 如果未安装,不返回任何结果(ECS的centos镜像默认未安装 ...

  6. centos7安装mysql

    centos7安装mysql 1 查找系统是否安装了myql rpm -q mysql mysql-server1.1如果安装了.就删除 sudo yum -y remove mysql mysql- ...

  7. centos7安装mysql(yum)

    centos7安装mysql(yum) ----安装环境----依赖安装----检查mysql是否已安装----安装----验证是否添加成功----选择要启用的mysql版本----通过Yum安装my ...

  8. CentOS7安装MySQL的方法之通用二进制格式

      CentOS7安装MySQL的方法之通用二进制格式          

  9. CentOS7安装MySQL的方法之RPM包方式

        CentOS7安装MySQL的方法之RPM包方式        

  10. 记录CentOS 7.4 上安装MySQL&MariaDB&Redis&Mongodb

    记录CentOS 7.4 上安装MySQL&MariaDB&Redis&Mongodb 前段时间我个人Google服务器意外不能用,并且我犯了一件很低级的错误,直接在gcp讲服 ...

随机推荐

  1. ajax回调函数中使用$(this)取不到对象的解决方法

    如果在ajax的回调函数内使用$(this)的话,实践证明,是取不到任何对象的,需要的朋友可以参考下 $(".derek").each(function(){ $(this).cl ...

  2. Office 2013 标点符号自动变成calibri字体

    在字体设置中,已经设置西文字体为“(使用中文字体)”,结果office 2013还是自动将输入的英文符号自动变成calibri字体. 举例:输入以下一段话 好好学习,天天向上. 中文字体中后面跟着标点 ...

  3. android Fragment 笔记

    Fragment多用于平板中,Fragment当成Activity的一个界面的一个组成部分,Fragment有自己的生命周期,但是必须依托在Activity中. 参考链接 https://develo ...

  4. am335x LCD参数更改

    /******************************************************************** * am335x LCD参数更改 * * 本文记录am335 ...

  5. matlab中常用见的小知识点

    矩阵相关: 在matlab中,矩阵或向量是 column-major 表示形式.用 [] 来构建向量或矩阵, 用()来引用向量或矩阵中的元素:用:表示矩阵中的该index下的所以元素: matlab中 ...

  6. jQuery数组处理详解(转)

    1. $.each(array, [callback]) 遍历[常用] 解释: 不同于例遍 jQuery 对象的 $.each() 方法,此方法可用于例遍任何对象(不仅仅是数组哦~). 回调函数拥有两 ...

  7. Javascript的setTimeOut和setInterval的定时器用法

    setTimeout() 方法用于在指定的毫秒数后调用函数或计算表达式,而setInterval()则是在每隔指定的毫秒数循环调用函数或表达式, 直到 clearInterval把它清除.也就是说se ...

  8. [转] COM编程总结

    一.Com概念 所谓COM(Componet Object Model,组件对象模型),是一种说明如何建立可动态互变组件的规范,此规范提供了为保证能够互操作,客户和组件应遵循的一些二进制和网络标准.通 ...

  9. 第四章 Spring.Net 如何管理您的类___对象的自动装配

    由于这几天都比较忙,所以对笔记暂时没有更新. Spring.NET具有自动装配的能力,也就是说,Spring.NET可以通过对象的定义自动分辨某个对象的协作对象.自动装配是针对单个对象(按:针对每个协 ...

  10. Redis生成Id主键的工具

    public class PrimaryKeyGenerator { private static readonly NedisClient client = new NedisClient(GetR ...