[root@www ~]# yum -y install mysql-server
[root@www ~]# /etc/rc.d/init.d/mysqld start
Initializing MySQL database: 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 www.server.world 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!
Starting mysqld: [ OK ]
[root@www ~]# chkconfig mysqld on
[root@www ~]# mysql -u root # connect to MySQL
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.52 Source distribution
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
# show user info
mysql> select user,host,password from mysql.user;
# set root password
mysql> set password for root@localhost=password('password');
Query OK, 0 rows affected (0.00 sec)
# set root password
mysql> set password for root@'127.0.0.1'=password('password');
Query OK, 0 rows affected (0.00 sec)
# set root password
mysql> set password for root@'www.server.world'=password('password');
Query OK, 0 rows affected (0.00 sec)
# delete anonymous user
mysql> delete from mysql.user where user='';
Query OK, 2 rows affected (0.00 sec)
mysql> select user,host,password from mysql.user;
mysql> exit # quit
Bye
[root@www ~]# mysql -u root -p # connect with root
Enter password:# MySQL root password
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.52 Source distribution
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> exit
Bye
分享到:
相关推荐
centos7.0安装mysql centos7.0安装mysql centos7.0安装mysql
本教程将详细讲解如何在CentOS 6上安装MySQL 5.6.x版本,并涉及如何自定义安装路径,以满足特定的需求。 1. **准备工作** 在开始安装前,确保系统已经更新到最新状态,运行`yum update`来获取最新的软件包和安全...
总结,安装和配置MySQL 5.7.1在CentOS 6.8上的步骤包括:获取MySQL YUM源,使用`yum`安装MySQL服务器,启动并设置MySQL服务,获取并更改root用户密码,配置iptables允许3306端口的远程访问,以及更新MySQL的用户权限...
Centos6.7系统安装MySQL5.7总结 本资源总结了在Centos6.7系统中安装MySQL5.7的步骤,包括下载和安装MySQL软件包,创建数据库仓库目录,新建MySQL用户和组,修改目录属有者,配置参数,修改系统配置文件,启动MySQL...
centos6安装mysql5.7.22,步骤很详细。可以直接按照步骤来进行安装。
CentOS 7 安装 MySQL
CentOS 6 安装 MySQL 5.6 MySQL 是一个流行的开源关系数据库管理系统,广泛应用于 Web 应用程序中。 CentOS 6 是一个基于 Linux 的操作系统,本文将指导您如何在 CentOS 6 上安装 MySQL 5.6。 关闭 SELinux ...
### CentOS 7.4 安装 MySQL 5.7 的详细步骤及注意事项 #### 一、安装流程 1. **进入指定目录** 首先,打开终端并进入到 `/usr/local/` 目录下: ```bash cd /usr/local/ ``` 2. **创建工具目录** 接着,...
在本地虚拟机的场合,需要更换yum安装网络地址配置文件CentOS-Base.repo 从阿里云服务器下载一份CentOS-Base.repo文件存到本地
centos 6.5下安装配置mysql,以及mysql的安全管理和账户管理
本文将详细介绍如何在CentOS 6.5上进行MySQL 5.6的一键安装过程,包括必要的环境准备、安装步骤、配置优化以及安全设置。 一、环境准备 在开始安装之前,确保你的CentOS 6.5系统已经更新到最新,运行以下命令进行...
### CentOS安装MySQL 5.7知识点详解 #### 一、环境准备与系统要求 在开始安装MySQL 5.7之前,我们需要确保系统满足以下条件: - **操作系统**:CentOS 7.x或更高版本。 - **硬件配置**:至少1GB内存,推荐2GB以上;...
在本教程中,我们将深入探讨如何在CentOS7操作系统上安装MySQL 5.7.19并设置主从复制配置。MySQL的主从复制是一种常用的技术,它允许数据从一个服务器(主服务器)同步到另一个服务器(从服务器),从而实现数据备份...
解决CentOS 7安装mysql后3306端口不通
本文档详细介绍了在Centos7系统上安装mysql8.0的步骤,包括卸载系统自带的mariadb,安装mysql依赖项,上传和解压mysql压缩包,创建安装目录、mysql用户和组,创建数据目录和配置文件,安装数据库,生成初始密码,...
centos7.9 自动安装mysql8.0.33,附带脚本
本教程将详细介绍如何在CentOS 7上完整地安装和配置MySQL 5.7。 一、安装MySQL 5.7 1. 更新系统:首先确保你的CentOS 7系统是最新的,运行`sudo yum update`。 2. 安装依赖:MySQL 5.7的安装需要一些依赖包,执行...
centos7安装mysql方法
本教程将详细讲解如何在CentOS 8上安装MySQL并配置允许远程访问。 首先,安装MySQL前需要确保系统中没有已存在的MySQL或MariaDB实例。你可以通过以下命令检查: ```bash rpm -qa | grep mysql rpm -qa | grep ...