Linux利用rpm包安装mysql5.7.15 Mysql安装的三种模式:rpm包安装、二进制安装和源码安装三种,其中rpm包安装最为简单,本文档只讲述该安装方式
groupadd mysql;
useradd–g mysql mysql
利用ftp工具将mysql的安装包上传
利用tar工具进行解压
可根据实际需要选择进行相应rpm包的安装,本手册主要安装server和client 两个rpm包,该包以来common和libs包,具体的安装顺序如下:
4.配置文件位置及查看
安装完毕后会自动在/etc目录下面生成一个myf的配置文件
cat/etc/myf
5.生成的root的密码通过查看日志
根据上述的myf查看知悉mysql的日志为mysqld.log,位置在/var/log/,可打开直接搜索A temporary password is generated for root@localhost:查看初始化密码,一般在日志的前几行比较考前,如下红框即为root的初始化密码
6、启动及系统初始化
(1)启动
Service mysqld start
(2)初始化
使用mysql_secure_installation进行初始化的设置mysql_secure_installation 命令的地址为/usr/bin,执行如下
/usr/bin/mysql_secure_installation
New password:--更换root用户密码
Re-enter new password:
Estimated strength of the password:100
Do you wish to continue with the password provided?(Press y|Y for Yes,any other key for No):y
By default,a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them.This is intended only for
testing,and to make the installation go a bit smoother.mysql下载后怎么安装不了
You should remove them before moving into a production
environment.
Remove anonymous users?(Press y|Y for Yes,any other key for No):y—删除自带用户
Success.
Normally,root should only be allowed to connect from
'localhost'.This ensures that someone cannot guess at
the root password from the network.
Disallow root login remotely?(Press y|Y for Yes,any other key for No):y—是否只在mysql服务器上使用root用户登录
Success.
By default,MySQL comes with a database named'test'that
anyone can access.This is also intended only for testing,
and should be removed before moving into a production
environment.
Remove test database and access to it?(Press y|Y for Yes,any other key for No): y—删除自带测试库
-Dropping
Success.
-Removing privileges on
Success.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now?(Press y|Y for Yes,any other key for No):y—不加在权限表
Success.
All done!
7、登录
标准登录命令为mysql–hip–uname–pport–ppasswd dbname
可以直接只用mysql–p此命令默认是root用户登录,如下
8.rpm包安装目录介绍
其中rpm包安装各个文件存储在如下:
[root@rhel5~]#find/-name mysql-print /etc/logrotate.d/mysql
/etc/rc.d/init.d/mysql
/var/lib/mysql
/var/lib/mysql/mysql
/
var/lock/subsys/mysql
/usr/lib/mysql
/usr/include/mysql
/usr/share/mysql
/usr/bin/mysql
而data默认放在:/var/lib/mysql
mysql默认安装在了:/usr/share/mysql中

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。