centos7安装mysql(MariaDB)
1.centos7现状:
新系统无法再使用yum install mysql-server来安装mysql,因为已使用mariadb代替mysql。
2.安装mariadb:
[root@localhost ~]# yum -y install mariadb*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.linode.com
* extras: mirrors.linode.com
* updates: mirrors.linode.com
Resolving Dependencies
--> Running transaction check
---> Package mariadb.x86_64 :5.5.-.el7_0 will be installed
---> Package mariadb-bench.x86_64 :5.5.-.el7_0 will be installed
---> Package mariadb-devel.x86_64 :5.5.-.el7_0 will be installed
---> Package mariadb-embedded.x86_64 :5.5.-.el7_0 will be installed
---> Package mariadb-embedded-devel.x86_64 :5.5.-.el7_0 will be installed
---> Package mariadb-libs.x86_64 :5.5.-.el7_0 will be installed
---> Package mariadb-server.x86_64 :5.5.-.el7_0 will be installed
--> Processing Dependency: perl-DBD-MySQL for package: :mariadb-server-5.5.-.el7_0.x86_64
---> Package mariadb-test.x86_64 :5.5.-.el7_0 will be installed
--> Running transaction check
---> Package perl-DBD-MySQL.x86_64 :4.023-.el7 will be installed
--> Finished Dependency Resolution Dependencies Resolved ==========================================================================================================
Package Arch Version Repository Size
==========================================================================================================
Installing:
mariadb x86_64 :5.5.-.el7_0 updates 8.9 M
mariadb-bench x86_64 :5.5.-.el7_0 updates k
mariadb-devel x86_64 :5.5.-.el7_0 updates k
mariadb-embedded x86_64 :5.5.-.el7_0 updates 3.6 M
mariadb-embedded-devel x86_64 :5.5.-.el7_0 updates 7.4 M
mariadb-libs x86_64 :5.5.-.el7_0 updates k
mariadb-server x86_64 :5.5.-.el7_0 updates M
mariadb-test x86_64 :5.5.-.el7_0 updates 7.9 M
Installing for dependencies:
perl-DBD-MySQL x86_64 4.023-.el7 base k Transaction Summary
==========================================================================================================
Install Packages (+ Dependent package) Total download size: M
Installed size: M
Downloading packages:
(/): mariadb-bench-5.5.-.el7_0.x86_64.rpm | kB ::
(/): mariadb-devel-5.5.-.el7_0.x86_64.rpm | kB ::
(/): mariadb-embedded-5.5.-.el7_0.x86_64.rpm | 3.6 MB ::
(/): mariadb-5.5.-.el7_0.x86_64.rpm | 8.9 MB ::
(/): mariadb-libs-5.5.-.el7_0.x86_64.rpm | kB ::
(/): mariadb-server-5.5.-.el7_0.x86_64.rpm | MB ::
(/): mariadb-embedded-devel-5.5.-.el7_0.x86_64.rpm | 7.4 MB ::
(/): mariadb-test-5.5.-.el7_0.x86_64.rpm | 7.9 MB ::
(/): perl-DBD-MySQL-4.023-.el7.x86_64.rpm | kB ::
----------------------------------------------------------------------------------------------------------
Total MB/s | MB ::
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : :mariadb-libs-5.5.-.el7_0.x86_64 /
Installing : :mariadb-5.5.-.el7_0.x86_64 /
Installing : perl-DBD-MySQL-4.023-.el7.x86_64 /
Installing : :mariadb-server-5.5.-.el7_0.x86_64 /
Installing : :mariadb-devel-5.5.-.el7_0.x86_64 /
Installing : :mariadb-embedded-5.5.-.el7_0.x86_64 /
Installing : :mariadb-embedded-devel-5.5.-.el7_0.x86_64 /
Installing : :mariadb-test-5.5.-.el7_0.x86_64 /
Installing : :mariadb-bench-5.5.-.el7_0.x86_64 /
Verifying : :mariadb-test-5.5.-.el7_0.x86_64 /
Verifying : :mariadb-embedded-devel-5.5.-.el7_0.x86_64 /
Verifying : :mariadb-embedded-5.5.-.el7_0.x86_64 /
Verifying : :mariadb-libs-5.5.-.el7_0.x86_64 /
Verifying : :mariadb-bench-5.5.-.el7_0.x86_64 /
Verifying : :mariadb-5.5.-.el7_0.x86_64 /
Verifying : :mariadb-server-5.5.-.el7_0.x86_64 /
Verifying : perl-DBD-MySQL-4.023-.el7.x86_64 /
Verifying : :mariadb-devel-5.5.-.el7_0.x86_64 / Installed:
mariadb.x86_64 :5.5.-.el7_0 mariadb-bench.x86_64 :5.5.-.el7_0
mariadb-devel.x86_64 :5.5.-.el7_0 mariadb-embedded.x86_64 :5.5.-.el7_0
mariadb-embedded-devel.x86_64 :5.5.-.el7_0 mariadb-libs.x86_64 :5.5.-.el7_0
mariadb-server.x86_64 :5.5.-.el7_0 mariadb-test.x86_64 :5.5.-.el7_0 Dependency Installed:
perl-DBD-MySQL.x86_64 :4.023-.el7 Complete!
[root@localhost ~]# systemctl start mariadb.service
[root@localhost ~]# systemctl enable mariadb.service
ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.servi
ce'
[root@localhost ~]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is
Server version: 5.5.-MariaDB MariaDB Server Copyright (c) , , Oracle, Monty Program Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> logout
-> exit
->
-> ;
ERROR (): You have an error in your SQL syntax; check the manual that corresponds to your MariaD
B server version for the right syntax to use near 'logout
exit' at line 1
MariaDB [(none)]> exit
Bye
[root@localhost ~]# systemctl enable mariadb.service
[root@localhost ~]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is
Server version: 5.5.-MariaDB MariaDB Server Copyright (c) , , Oracle, Monty Program Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
rows in set (0.00 sec) MariaDB [(none)]> use test
Database changed
MariaDB [test]> show tables;
Empty set (0.00 sec) MariaDB [test]> exit
Bye
[root@localhost ~]# mysql_secure_installation
/usr/bin/mysql_secure_installation: line : find_mysql_client: command not found NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here. ERROR (): Access denied for user 'root'@'localhost' (using password: YES)
Enter current password for root (enter for none):
OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation. Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success! By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment. Remove anonymous users? [Y/n] y
... Success! Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] y
... Success! By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment. Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success! Reloading the privilege tables will ensure that all changes made so far
will take effect immediately. Reload privilege tables now? [Y/n] y
... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB
installation should now be secure. Thanks for using MariaDB!
[root@localhost ~]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is
Server version: 5.5.-MariaDB MariaDB Server Copyright (c) , , Oracle, Monty Program Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| zbphp.com |
+--------------------+
rows in set (0.00 sec) MariaDB [(none)]>
centos7安装mysql(MariaDB)的更多相关文章
- centos7安装mysql mariadb
从最新版本的linux系统开始,默认的是 Mariadb而不是mysql! 使用系统自带的repos安装很简单: yum install -y mariadb mariadb-server 启动mar ...
- CentOS7安装mysql提示“No package mysql-server available.”
针对centos7安装mysql,提示"No package mysql-server available."错误,解决方法如下: Centos 7 comes with Mari ...
- [CentOs7]安装mysql(2)
摘要 之前安装过一次mysql,最后配置,发现在本地无法连接,重启服务的时候一直卡在那里不动,感觉是安装的过程出问题,最后没办法还是卸载了,然后重新安装一下. [CentOs7]安装mysql Mys ...
- Linux - centos7 下 MySQL(mariadb) 和 主从复制
目录 Linux - centos7 下 MySQL(mariadb) 和 主从复制 MySQL(mariadb) 安装MySQL(mariadb) 配置数据库的中文支持 在远程用 mysql客户端去 ...
- centos7安装Mysql爬坑记录
centos7安装Mysql爬坑记录 查看是否已安装 使用下列命令查看是否已经安装过mysql/mariadb/PostgreSQL 如果未安装,不返回任何结果(ECS的centos镜像默认未安装 ...
- centos7安装mysql
centos7安装mysql 1 查找系统是否安装了myql rpm -q mysql mysql-server1.1如果安装了.就删除 sudo yum -y remove mysql mysql- ...
- centos7安装mysql(yum)
centos7安装mysql(yum) ----安装环境----依赖安装----检查mysql是否已安装----安装----验证是否添加成功----选择要启用的mysql版本----通过Yum安装my ...
- CentOS7安装MySQL的方法之通用二进制格式
CentOS7安装MySQL的方法之通用二进制格式
- CentOS7安装MySQL的方法之RPM包方式
CentOS7安装MySQL的方法之RPM包方式
- 记录CentOS 7.4 上安装MySQL&MariaDB&Redis&Mongodb
记录CentOS 7.4 上安装MySQL&MariaDB&Redis&Mongodb 前段时间我个人Google服务器意外不能用,并且我犯了一件很低级的错误,直接在gcp讲服 ...
随机推荐
- 微信小程序——获取绑定事件元素的ID
小程序list数据带值跳转,一般直接通过设置item的id来标识或者通过设置键值data-xxxx的方式标识.如下图所示: 解析出来的结果如下图: 我们看到它在元素上绑定了一个checkSchoolL ...
- js学习笔记21----表格操作
1.获取表格元素: tHead : 表格头 tBody : 表格主体内容 tFoot : 表格尾 rows : 表格行 cells : 表格列 如获取表格第一行第一列的数据: <script ...
- QSignalMapper类处理多信号关联同一个槽的方法(1)
QSignalMapper这个类并不是个新鲜概念, 早在Qt2里就已经存在, 而且它的功能也是始终如一. 不过由于宣传力度不够(例子里涉及到它的很少)了解这个类人可能还不是很多, 所以特此撰文介绍此类 ...
- 关于ARM中的tst、cmp、bne、beq指令
一.关于cmp的详细用法 假设现在AX寄存器中的数是0002H,BX寄存器中的数是0003H. 执行的指令是:CMP AX, BX 执行这条指令时,先做用AX中的数减去BX中的数的减法运算. 列出二进 ...
- 关于Cocos2d-x中物理世界的物体乱跳的问题的解决
这是电脑短时间内帧率低,无法满足游戏配置的帧率引起的. 解决方法: 第一种: 1.打开AppDelegate.cpp文件 2.把director->setAnimationInterval(1. ...
- Android APK反编译详解(附图) (转至 http://blog.csdn.net/ithomer/article/details/6727581)
本文Android反编译教程,测试环境: Win7 Ultimate x64 Ubuntu 12.04 x86_x64 反编译工具包 下载 (2012-10-10更新) 一.Apk反编译得到Java源 ...
- Oracle从字符串资源中得到想要的数据分析
[oracle]从字符串资源中得到想要的数据分析需求:订单分析,按照游戏,帐号级别,游戏帐号职业,区服,价格区间分析各款交易数据走势 .目标:订单表(order)处理分析:订单中可以直接读到的标示有游 ...
- js焦点轮播图
汇集网上焦点轮播图的实现方式,自己试了下,不过鼠标悬浮停止动画和鼠标离开动画播放好像没生效,不太明白,最后两行代码中,为什么可以直接写stop和play.不用加括号调用函数么?求懂的大神指点! 所用知 ...
- XP 终端服务组件 ,SP3 多用户补丁(替换)文件
如附件 termsrv.dll 5.1.2600.5512 目前存在一个问题:每个用户只能使用一个会话.不能像2003+那样,一个用户使用多个会话. 待查找解决方案中............... ...
- github前端资源
摘要: 本文将分享我在github上常用的一些插件,可能在开发中你会用到它,希望能够帮助你! 前端技术总结 url : https://github.com/JacksonTian/fks 简述: ...