|
BGP数据库高防服务器Linux系统安装数据库MySQL121.204.247.4
需要服务器咨询以下联系方式
联系人:火烧云小地瓜
扣扣:3007425289/2853898501
电话:18316411879
官网:http://huoshaocloud.com
服务承诺
1.提供一级电信运营商的资源。
2.可按用户要求进行IP地址指向的最优分配。
3.提供7×24小时技术支持服务。
4.如遇计划性中断,提前24小时通知。
5.根据客户需求提供流量监测,分析报告。
你找卖家,卖家再找公司,公司再找机房......
等处理好已经不是服务问题了,
而是时间,玩家流失的问题了,
这就和选老婆一样,老婆不会做家务也没用,
所以选服务器一定要选有售后保障的。
火烧云24小时在线售后!
您选择火烧云就不怕没人处理问题了!
1.将下载好的 mysql-8.0.18-el7-x86_64.tar.gz 通过 FinalShell 上传到服务器的目录,我放在 /home/zhjt 下
2.解压缩并改名为mysql
[zhjt@localhost ~]$ tar -zxvf mysql-8.0.18-el7-x86_64.tar.gz
[zhjt@localhost ~]$ mv mysql-8.0.18-el7-x86_64 mysql
12
3.创建mysql用户组及用户,并给mysql用户设置密码
[zhjt@localhost ~]# groupadd mysql
[zhjt@localhost ~]# useradd -r -g mysql mysql
[zhjt@localhost ~]# passwd mysql
更改用户 mysql 的密码 。
新的 密码:123qweGHJ
重新输入新的 密码:123qweGHJ
passwd:所有的身份验证令牌已经成功更新。
1234567
4.添加mysql配置文件:(/etc/my.cnf)
[zhjt@localhost ~]# vim /etc/my.cnf
1
内容如下:
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/ ... ation-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
basedir = /home/zhjt/mysql
datadir = /home/zhjt/mysql/data
port = 3306
# server_id = .....
socket = /tmp/mysql.sock
character-set-server = utf8
skip-name-resolve
log-error = /home/zhjt/mysql/data/error.log
pid-file = /home/zhjt/mysql/data/mysql.pid
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
1234567891011121314151617181920212223242526272829303132333435
然后保存退出。
5.在mysql目录下新建data文件夹用于存放数据库文件
[zhjt@localhost mysql]# mkdir data
6.在mysql当前目录下设定目录的访问权限(注意后面的小点,表示当前目录)
[zhjt@localhost mysql]# chown -R mysql .
[zhjt@localhost mysql]# chgrp -R mysql .
7.初始化数据库
[zhjt@localhost mysql]# ./bin/mysqld --initialize --user=mysql --basedir=/home/zhjt/mysql --datadir=/home/zhjt/mysql/data
打开日志文件,找到初始密码:
[zhjt@localhost mysql]# /home/zhjt/mysql/data/error.log
8. 启动mysql
[zhjt@localhost mysql]# ./support-files/mysql.server start
Starting MySQL............ SUCCESS!
9.登录mysql,修改root用户密码
[zhjt@localhost mysql]# ./bin/mysql -uroot -p
Enter password: 4t?iQnB,+5co
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.17
Copyright (c) 2000, 2019, 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> use mysql
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> alter user 'root'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.03 sec)
123456789101112131415161718
10.配置mysql允许远程访问
创建远程登录对象: CREATE USER 'root'@'%' IDENTIFIED BY '123456';
授权远程登录: grant all privileges on *.* to 'root'@'%' with grant option;
强制刷新: flush privileges;
mysql> CREATE USER 'root'@'%' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.01 sec)
mysql> grant all privileges on *.* to 'root'@'%' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
12345678
11.mysql启动、停止、重启命令
[zhjt@localhost mysql]# ./support-files/mysql.server start
Starting MySQL.. SUCCESS!
[zhjt@localhost mysql]# ./support-files/mysql.server restart
Shutting down MySQL.. SUCCESS!
Starting MySQL.. SUCCESS!
[zhjt@localhost mysql]# ./support-files/mysql.server stop
Shutting down MySQL.. SUCCESS!
1234567
|
|