安装:

1.新开的云服务器,需要检测系统是否自带安装mysql

# yum list installed | grep mysql

2.如果发现有系统自带mysql,果断这么干

# yum -y remove mysql-libs.x86_64

3.随便在你存放文件的目录下执行,这里解释一下,由于这个mysql的yum源服务器在国外,所以下载速度会比较慢,还好mysql5.6只有79M大,而mysql5.7就有182M了,所以这是我不想安装mysql5.7的原因

# wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm

4.接着执行这句,解释一下,这个rpm还不是mysql的安装文件,只是两个yum源文件,执行后,在/etc/yum.repos.d/ 这个目录下多出mysql-community-source.repo和mysql-community.repo

# rpm -ivh mysql-community-release-el6-5.noarch.rpm

5.这个时候,可以用yum repolist mysql这个命令查看一下是否已经有mysql可安装文件

#yum repolist all | grep mysql

6.安装mysql 服务器命令(一路yes):

# yum install mysql-community-server

7.安装成功后

# service mysqld start

8.由于mysql刚刚安装完的时候,mysql的root用户的密码默认是空的,所以我们需要及时用mysql的root用户登录(第一次回车键,不用输入密码),并修改密码

# mysql -u root
# use mysql;
# update user set password=PASSWORD("这里输入root用户密码") where User='root';
# flush privileges;

9.查看mysql是否自启动,并且设置开启自启动命令

# chkconfig --list | grep mysqld
# chkconfig mysqld on

10.mysql安全设置(系统会一路问你几个问题,看不懂复制之后翻译,基本上一路yes):

# mysql_secure_installation

11.晚安

 
# bye
#1.停止mysql数据库
/etc/init.d/mysqld stop
 
#2.执行如下命令
mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
 
#3.使用root登录mysql数据库
mysql -u root mysql
 
#4.更新root密码
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
#最新版MySQL请采用如下SQL:
mysql> UPDATE user SET authentication_string=PASSWORD('newpassword') where USER='root';
 
#5.刷新权限 
mysql> FLUSH PRIVILEGES;
 
#6.退出mysql
mysql> quit
 
#7.重启mysql
/etc/init.d/mysqld restart
 
#8.使用root用户重新登录mysql
mysql -uroot -p 
Enter password: <输入新设的密码newpassword>
 
外部链接linux下的mysql:

mysql:不能打开到主机的连接,在端口3306: 连接失败

mysql>GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'192.168.1.3' IDENTIFIED BY 'newpwd' WITH GRANT OPTION;
   mysql>flush privileges;

Linux下mysql出错:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)的更多相关文章

  1. 在Linux下 MySQL错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 解决办法【很管用】

    一般这个错误是由密码错误引起,解决的办法自然就是重置密码. 假设我们使用的是root账户. 1.重置密码的第一步就是跳过MySQL的密码认证过程,方法如下: #vim /etc/my.cnf(注:wi ...

  2. Ubuntu下 MySQL的“ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)”

    今天闲来无事,在Ubuntu上掏鼓一下mysql.但尴尬的是,当我输入mysql -u root -p的时候,抛出了一个错误:ERROR 1045 (28000): Access denied for ...

  3. 解决Linux下MySQL登录ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passwor)问题

    两种方案: 一: 1.修改mysql配置文件:vim /etc/my.cnf 2.找到[mysqld]下添加 skip-grant-tables 配置 3.重启服务service mysqld res ...

  4. 转: windows系统下mysql出现Error 1045(28000) Access Denied for user 'root'@'localhost'

    windows系统下mysql出现Error 1045(28000) Access Denied for user 'root'@'localhost' 转自 http://zxy5241.space ...

  5. Mysql:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    Mysql:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) Linux: MyS ...

  6. 解决mysql:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO/YES)

    一.问题 有时候我们登录Mysql输入密码的时候,会出现这种情况 mysql -u root -p Enter Password > '密码' 错误:ERROR 1045 (28000): Ac ...

  7. 【MySQL】ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    问题现象: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 拒绝访问root用户 ...

  8. mysql解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)的报错

    一般这个错误是由密码错误引起,解决的办法自然就是重置密码. 假设我们使用的是root账户. 1.重置密码的第一步就是跳过MySQL的密码认证过程,方法如下: #vim /etc/my.cnf(注:wi ...

  9. MySQL5.5出面ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)问题的解决办法

    问题描述 安装完MySQL5.5数据库,使用Navicat Premium以及命令窗口连接数据库都报以下错误: ERROR 1045 (28000): Access denied for user ' ...

  10. 【转载】重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passwor ...

随机推荐

  1. shell 字符串判断

    字符串的判断 '-z 字符串' 判断字符串是否为空(为空返回真) '-n 字符串' 判断字符串是否为非空(非空返回真) '字符串1==字符串2' 判断字符串1是否和字符串2相等(相等返回真) '字符串 ...

  2. Linux command parted

    Linux command parted [Purpose]        Learning linux command parted to manipulate disk partitions   ...

  3. 为什么IT运维工程师要学习Linux系统

    不论你是否知道,其实你每天都在使用Linux.每次你访问微博.百度甚至是一些小电影网站,你的客户端(浏览器)都在与运行在Linux系统上的服务端程序进行通讯,大多数的电子设备,例如数位录像机.飞机.自 ...

  4. Django ajax提交 登录

    一.url from django.contrib import adminfrom django.urls import pathfrom appo1 import views urlpattern ...

  5. 玩linux就是不断的踩坑,踩坑。最近的坑。xpath firefox兼容问题,抓取表格。

    最近在抓取一个页面表格时发现,用firefox提取的xpath,不能用,仔细分析后,发现是提取的xpath多了一个tbody标签.在xpath路径中删掉这段就好了. last_A5='/html/bo ...

  6. springmvc添加拦截器

    springmvc.xml配置如下: 除了 sysFile 下的所有接口,以及user下的loginUser接口,其他的所有接口都会经过拦截器UserInterceptor处理 <mvc:int ...

  7. linux程序的常用保护机制

    操作系统提供了许多安全机制来尝试降低或阻止缓冲区溢出攻击带来的安全风险,包括DEP.ASLR等.在编写漏洞利用代码的时候,需要特别注意目标进程是否开启了DEP(Linux下对应NX).ASLR(Lin ...

  8. vim 使用和配置

    vim 启动的时候,默认加载用户目录下.vimrc的配置文件,如果不存在,则会加载系统配置文件/etc/vim/vimrc ~/.vimrc文件配置 #避免中文乱码set fileencodings= ...

  9. unity3d 九宫密码锁

    using UnityEngine;using System.Collections.Generic;using System;using UnityEngine.EventSystems;using ...

  10. 文件操作---with语句

    with语句 为了避免打开文件后忘记关闭,可以通过管理上下文,即: with open('file','r','encoding='uth-8'') as f: #f为文件句柄 for line in ...