首页 技术 正文
技术 2022年11月15日
0 收藏 619 点赞 4,492 浏览 1478 个字

原文地址:http://www.cnblogs.com/zhongshengzhen/第1步、yum安装mysql[root@localhost ~]# yum -y install mysql-server 第2步、设置开机启动[root@localhost ~]# chkconfig mysqld on 第3步、启动MySql服务[root@localhost ~]# service mysqld start 第4步、设置MySQL的root用户设置密码[root@localhost ~]# mysql -u rootmysql> set password for root@localhost=password(‘root’);mysql> show databases;
+——————–+
| Database           |
+——————–+
| information_schema |
| mysql              |
| test               |
+——————–+mysql> exit 第5步、用新密码登陆
[root@stonex ~]#  mysql -u root -p[root@localhost ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g. 第6步、基本命令
show databases; //查看系统已存在的数据库
use databasesname;   //选择需要使用的数据库
drop database databasename; //删除选定的数据库
exit    //退出数据库的连接
create database test01;    //建立名为test的数据库
show tables;        // 列出当前数据库下的表
其他基本的增删改查使用标准SQL即可

第7步、开放远程登录权限

GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ IDENTIFIED BY ‘root’ WITH GRANT OPTION;
FLUSH PRIVILEGES;  FQA:mysql工具连接不上mysql数据库

Error1: 2003:Can’t connect to MySQL server on ‘localhost’

解决方法:关闭Linux的防火墙功能。

  1. #chkconfig iptables off
  2. #reboot

Error2: 1130 – Host’ClientIP’ is not allowed to connect to this MySQL server

解决方法:使用root用户登陆Linux,更改容许登陆的IP地址范围。

  1. mysql>grant all privileges on *.* to ‘root’@’%’ identified by ‘rootpasswd’ with grant option;

 这段指令容许所有用root用户输入密码登陆该mysql server,如果将’%’ 换乘’192.168.1.124′ ,那么只有’192.168.1.124’的主机可以登陆。

现在重新用Navicat连接Linux mysql 便可以成功了。

  卸载MYSQL1、yum remove mysql mysql-server mysql-libs compat-mysql51 

2、rm -rf /var/lib/mysql

3、rm /etc/my.cnf

查看是否还有mysql软件:
rpm -qa|grep mysql

如果存在的话,继续删除即可。

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,967
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,487
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,332
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,115
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,748
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,783