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安装 ...
随机推荐
- PHP函数对比 array_merge()与加号合并数组的区别
首先准备两个数组,从数组索引类型分别讨论. 数组索引为字符串索引时: $a = array('a' => 1, 'b' => 2, 'c' => 3); $b = array('b' ...
- 使用Vmware过程中,突然网络连接不上问题
###第一次的解决方法: 1.我一般过一段时间就会对虚拟机进行拍快照备份:在使用过程中,如果没有太大变化,恢复网络正常的快照一般是能解决问题的,但是要记得恢复快照之前要备份你已经修改过的所有东西,以防 ...
- linux 安装 Django14
一.实际安装过程(只操作这一步就可以安装) ## 下载并安装 rpm -ivh http://cbs.centos.org/kojifiles/packages/Django14/1.4.20/1.e ...
- docker在windows下和linux下网络底层的一些区别
windows和linux下的docker运行时的网络结构是有区别的 a.windows下,默认使用Hyper-v创建一个linux虚拟机,承载docker.所以从外向内的路径为: windows - ...
- matlab 霍夫变换—检测圆
function [hough_space,hough_circle,para] = hough_Circle(BW,step_r,step_angle,r_min,r_max,p) % %%%%%% ...
- Ansible:playbook-nagios
一.创建目录结构 cd /etc/ansible/roles/ mkdir nagios/{files,templates,vars,handlers,meta,default,tasks} -pv ...
- LED Keychain - Widely Used Logo Item
The LED keychain makes it easy for people to carry their keys with them and carry them with them. It ...
- Tomcat/conf/server.xml文件中docBase和path的说明
Tomcat的项目部署方式有以下三种: 1.直接把项目复制到Tomcat安装目录的webapps目录中,这是最简单的一种Tomcat项目部署的方法.2.在tomcat安装目录中有一个conf文件夹,打 ...
- 访问windows共享无法分配内存问题解决
设置:“HKLMSYSTEMCurrentControlSetControlSession ManagerMemory ManagementLargeSystemCache” 为 “1″ 设置:“HK ...
- ps怎么把一种颜色变成另一种颜色
使用软件:PS CC版 使用Photoshop 将图片中的一种颜色变成另一种颜色的两种方法: 1.打开图片,Ctrl+J复制一份: 2.执行菜单-选择-色彩范围,使用吸管和吸管+选取图片颜色部分,点确 ...