center os7 安装mysql

news/2024/7/5 2:33:53

安装mariadb

MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可。开发这个分支的原因之一是:甲骨文公司收购了MySQL后,有将MySQL闭源的潜在风险,因此社区采用分支的方式来避开这个风险。MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能轻松成为MySQL的代替品。

安装mariadb,大小59 M。

[root@yl-web yl]# yum install mariadb-server mariadb 

mariadb数据库的相关命令是:

systemctl start mariadb  #启动MariaDB

systemctl stop mariadb  #停止MariaDB

systemctl restart mariadb  #重启MariaDB

systemctl enable mariadb  #设置开机启动

所以先启动数据库

[root@yl-web yl]# systemctl start mariadb

然后就可以正常使用mysql了

复制代码
[root@yl-web yl]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.41-MariaDB MariaDB ServerCopyright (c) 2000, 2014, Oracle, MariaDB Corporation 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               |
+--------------------+
4 rows in set (0.00 sec)MariaDB [(none)]> 
复制代码

安装mariadb后显示的也是 MariaDB [(none)]> 

 

卸载mysql:

  1. [root@localhost usr]# yum remove mysql mysql-server mysql-libs compat-mysql51  
  2. [root@localhost usr]# rm -rf /var/lib/mysql  
  3. [root@localhost usr]# rm /etc/my.cnf  

 

方式2(mysql ):

官网下载安装mysql-server

# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
# rpm -ivh mysql-community-release-el7-5.noarch.rpm
# yum install mysql-community-server


默认安装完没有密码
use mysql

set password for 'root'@'localhost' =password('password');设置mysql登录密码

http://lihuaxi.xjx100.cn/news/239530.html

相关文章

对 makefile 中 .SECONDARY 的学习体会

上例子 LIBSfoo.gao bar.gao .INTERMEDIATE:$(LIBS) .SECONDARY:bar.gao all: $(LIBS) #pass foo.gao: echo $ touch $ bar.gao: echo $ touch $   make --dry-run 的结果: foo.gao touch foo.gao bar.gao touch bar.gao #pass rm foo.gao 可见,SECONDARY 确实起到…

我的第一个web_登陆我的第一个全栈Web开发人员职位

我的第一个webby Robert Cooper罗伯特库珀(Robert Cooper) 登陆我的第一个全栈Web开发人员职位 (Landing My First Full Stack Web Developer Job) This is the story of the steps I took to get my first job as a full stack web developer. I think it’s valuable to sha…

加了好友怎么还掉血_微信聊天窗口出现风险提醒,无法添加好友解决办法

再更,你想马上解封,你得有朋友。没有朋友,你就等个十天半个月!更新一下 帖子浏览人挺多的,有问题可以在评论里相互交流,下面是原文:先让我说一句脏话:傻x微信风控系统 终于特么的聊天…

android随手记

Linearlayout:   gravity:本元素中所有子元素的重力方向   layout_gravity:本元素对于父元素的重力方向 自定义权限:http://www.cnblogs.com/it-tomorrow/p/4115161.html 注意:1 .在被调用时就算是normal权限也需要在加入,不然会permission Deney,在…

Keras 最新《面向小数据集构建图像分类模型》

本文地址:http://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html 本文作者:Francois Chollet 按照官方的文章实现过程有一些坑,彻底理解代码细节实现,理解keras的api具体使用方法也有…

aws lambda使用_使用AWS Lambda安排Slack消息

aws lambda使用Migrating to serverless brings a lot of questions. How do you do some of the non-serverless tasks, such as a cronjob in a serverless application?迁移到无服务器带来了很多问题。 您如何执行一些非无服务器的任务,例如无服务器应用程序中的…

powershell连接数据库_PowerShell 连接SQL Server 数据库

PowerShell 通过ADO.NET连接SQL Server数据库,并执行SQL脚本。工作中整理的一小段脚本,后来没有用上,先记录在这里:建立数据库连接查询返回一个DataTatble对象执行一条SQL语句通过事物执行多条SQL语句## 建立数据库连接.#function…

16G 手机清理

1.16G 手机清理 清理top 5 的应用的缓存即可 2,hw wife 连接模块 低于 app wifi 的连接模块。 在同样的电脑热点面前,hw 连补上电脑热点,apple 可以连上电脑热点。 其他差异不大。 2.奇兔刷机 tencent应用宝 and 手机管理,备份软件 http://w…