centos默认安装mysql的默认密码
安装centos时选择安装Mysql 服务器
mysql的默认登录密码为空,但是直接登录的时候有报错:
[root@localhost bin]# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
应该是没有起mysql服务。
先查看mysql服务的状态:
[root@localhost bin]# /etc/rc.d/init.d/mysqld status
mysqld 已停
启动mysql服务:
[root@localhost bin]# /etc/rc.d/init.d/mysqld start
初始化 MySQL 数据库: WARNING: The host 'xxaq' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h xxaq password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
[确定]
正在启动 mysqld: [确定]
查看mysql状态
[root@localhost bin]# ps -aef|grep mysql
root 17468 1 0 08:57 pts/1 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysql
mysql 17573 17468 0 08:57 pts/1 00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock
root 17600 17169 0 08:57 pts/1 00:00:00 grep mysql
此时再登录,没有报错:
[root@localhost bin]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
centos默认安装mysql的默认密码的更多相关文章
- Oracle 10g 默认安装带来的用户名/密码
ORACLE数据库创建的时候,创建了一系列默认的用户和表空间 Oracle 10g 默认安装带来的用户名/密码 Username Password Description See Also CTXSY ...
- 使用rpm安装mysql的默认目录
--使用rpm安装mysql的默认目录:1.数据库目录/var/lib/mysql/2.配置文件/usr/share/mysql(mysql.server命令及配置文件)3.相关命令/usr/bin( ...
- Centos下安装mysql 总结
一.MySQL安装 Centos下安装mysql 请点开:http://www.centoscn.com/CentosServer/sql/2013/0817/1285.html 二.MySQL的几个 ...
- Centos下安装mysql 和挂载硬盘
一,CentOS下安装Mysql 6.5 1.检测系统是否自带安装mysql # yum list installed | grep mysql 2.删除已经安装的Mysql # yum -y rem ...
- 二进制安装MySQL及破解密码
二进制安装MySQL及破解密码 1.确保系统中有依赖的libaio 软件,如果没有: yum -y install libaio 2.解压二进制MySQL软件包 tar xf mysql-5.7.24 ...
- CentOS 7 安装 MySQL Database
CentOS 7 安装 MySQL Database 1. 现在安装包,MySQL的安装包被分成了社区版和企业版,而本文将记录社区版本MySQL安装过程,下载MySQL版本如下: mysql-5.7. ...
- 【linux系列】Centos下安装mysql数据库
前言 为了测试方便,通常我们会自己安装数据库,以下是在Centos上安装Mysql的操作. 一.检查自己是否安装了MySQL数据库 [root@s201 /home/mysql]#rpm -qa |g ...
- 在centos上安装mysql
本文依然是用的xftp上传gz文件,然后在xShell上操作的,如果没有安装使用这两个文件的请查阅之前的博客. 1.将下载好的文件用xftp上传到对应的位置. 2.解压文件:tar -zvxf m ...
- centos 7 安装MySQL 5.7.23
centos 7 安装MySQL 5.7.23 1. 上传MySQL安装包到服务器 mysql-5.7.23-linux-glibc2.5-x86_64.tar.gz 2. 解压MySQL安装 ...
随机推荐
- SpringMVC组件解析
SpringMVC组件解析 1. 前端控制器:DispatcherServlet 用户请求到达前端控制器,它就相当于 MVC 模式中的 C,DispatcherServlet 是整个流程控制的中心,由 ...
- AntDesign(React)学习-8 Menu使用 切换框架页内容页面
本节实现一个点击左侧menu在右侧content切换页面效果,原始代码请从UMI学习-6开始看 1.在pages下添加两个组件,User,UserRole import React from 'rea ...
- [codeigniter4]Upgrading from 3.x to 4.x
CodeIgniter 4 is a rewrite of the framework, and is not backwards compatible. It is more appropriate ...
- pve proxmox 常见问题,perl warning
pve命令,如下报错 perl: warning: Setting locale failed. perl: warning: Please check that your locale settin ...
- EF中的查询方法
1.Linq to Entity(L2E)查询 默认返回IQueryable类型 2.原生SQL查询和操作 ①DbSet.SqlQuery()和Database.SqlQuery() 返回DbSqlQ ...
- Oracle tnsnames.ora
安装过ORACLE的都知道,oracle安装时需要进行配置,这个配置可以在客户端的企业管理器一步一步进行,或者直接拷贝一个tnsnames.ora文件到安装目录下(c:\app\Administrat ...
- python3练习100题——027
又是一道迭代的题,没做好. 看了答案才试着写出来. 我一定要加油啊,为了尽快摆脱现在讨厌的生活! 原题链接:http://www.runoob.com/python/python-exercise-e ...
- git免密拉取代码
里介绍通过ssh公钥的方式免密拉取代码 以linux服务器为例,windows方式是一样的 1.用命令生成ssh key ssh-keygen -t rsa -C "xx@xxxcom&qu ...
- spring(四):DI流程
在IoC容器初始化过程中,一般不包含Bean依赖注入的实现. 依赖注入一般发生在应用第一次向容器获取Bean时(getBean),但是有一个例外. 在使用IoC容器时有一个预实例化的配置,即通过laz ...
- argmax( )
argmax是一种函数,是对函数求参数(集合)的函数. 当我们有另一个函数y=f(x)时,若有结果x0= argmax(f(x)),则表示当函数f(x)取x=x0的时候,得到f(x)取值范围的最大值: ...