首页 / MYSQL / 二进制安装mysql5.6(参考)
二进制安装mysql5.6(参考)
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了二进制安装mysql5.6(参考),小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2853字,纯文字阅读大概需要5分钟。
内容图文
![二进制安装mysql5.6(参考)](/upload/InfoBanner/zyjiaocheng/913/85d501cb8a0440768f34bb7a5cdecdeb.jpg)
########数据库安装#######
1.1. 上传安装文件压缩包: mysql-5.6.38-linux-glibc2.12-x86_64.tar
1.2. 解压并修改文件名
tar -xvf mysql-5.6.38-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.6.38-linux-glibc2.12-x86_64 /application/
cd /application/
mv mysql-5.6.38-linux-glibc2.12-x86_64 mysql56
1.3. 创建组和用户及密码
#groupadd mysql
#useradd mysql -g mysql
mkdir -p /application/mysql56/data
chown -R mysql:mysql /application/mysql56
#passwd mysql
mkdir -p /var/log/mariadb/
cd /var/log/mariadb/
touch mariadb.log
chown mysql.mysql mariadb.log
1.4. 数据库初始化
/application/mysql56/scripts/mysql_install_db --user=mysql --basedir=/application/mysql56 --datadir=/application/mysql56/data
1.5 修改 mysql.server 参数
路径:/application/mysql56/support-files/mysql.server
修改 mysql.server 的基本和数据存放路径(basedir,datadir)
1.6 配置 my.cnf 文件(供参数)
路径:base_dir 下
#/application/mysql56/my.cnf
port = 3306
socket = /application/mysql56/data/mysql13326.sock
federated
basedir=/application/mysql56
datadir=/application/mysql56/data
innodb_data_home_dir = /application/mysql56/data
innodb_log_group_home_dir = /application/mysql56/data
log-bin=mysql-bin
server-id = 1
lower_case_table_names=1
relay_log_purge=0
long_query_time = 1
event_scheduler = ON
binlog_format=ROW
innodb_log_files_in_group = 1
innodb_max_dirty_pages_pct = 90
innodb_buffer_pool_size=1G
innodb_log_file_size = 25M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 120
character_set_server = utf8
expire_logs_days=3
[mysqld_safe]
log-error = /var/log/mariadb/mariadb.log
涉及修改内容:server-id,相关的基本存储路径和数据存储路径,端口号,socket 文件路径,如果已有/data/auto.cnf则删除
日志路径:/var/log/mariadb/mariadb.log
1.7 启动关闭服务
/application/mysql56/support-files/mysql.server start|stop|restart
1.8 修改 mysql 用户 root 密码
修 改 密 码 : /application/mysql56/bin/mysqladmin -u root password 'root123456' -h127.0.0.1 -P3306
修改成功且会有一个提示:
Warning: Using a password on the command line interface can be insecure.
1.8 完成
修改root密码:
mysql -uroot -p -P3306 -h127.0.0.1
select user,password,host from mysql.user;
delete from mysql.user where user='';
delete from mysql.user where password ='' and user='root';
1.9#mysql 加入到service服务中
cp /application/mysql56/support-files/mysql.server /etc/rc.d/init.d/
cd /etc/rc.d/init.d/
mv mysql.server mysql
2.0 创建开发用户,查询只读用户
#开发用户
create user 'developer'@'%';
SET PASSWORD FOR 'developer'@'%' = PASSWORD('xxxxxx');
grant select ,update,delete,insert ,create,CREATE ROUTINE,CREATE TEMPORARY TABLES,CREATE VIEW,EXECUTE,FILE,INDEX,LOCK TABLES,SHOW DATABASES
,SHOW VIEW,TRIGGER on *.* to 'developer'@'%';
flush privileges;
#查询用户
create user 'db_select'@'%';
SET PASSWORD FOR 'db_select'@'%' = PASSWORD('xxxxxxxx');
grant select,process on *.* to 'db_select'@'%';
flush privileges;
内容总结
以上是互联网集市为您收集整理的二进制安装mysql5.6(参考)全部内容,希望文章能够帮你解决二进制安装mysql5.6(参考)所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。