时间:2021-05-24
首先从官网下载zip archive版本http://dev.mysql.com/downloads/mysql/
MySQL v5.7.19 官方正式版(32/64位 安装版与zip解压版)
一、优化部分
1.操作系统参数调优
2.数据库参数调优
3.防火墙设置等
#############################
二、安装部分
1.创建用户和组
# groupadd mysql# useradd -g mysql mysql2.创建数据库安装目录、授权
# mkdir /mysql /mysql/data /mysql/log # chown -R mysql:mysql /usr/local/mysql3.到安装目录,解压安装文件
#cd /usr/local# tar -zxvf mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz# mv mysql-5.7.19-linux-glibc2.12-x86_64 mysql4.授权
# chown -R mysql.mysql mysql5.验证权限
# ls -l mysqltotal 52drwxr-xr-x 2 mysql mysql 4096 Aug 8 04:06 bin-rw-r--r-- 1 mysql mysql 17987 Jun 22 22:13 COPYINGdrwxr-xr-x 2 mysql mysql 4096 Aug 8 04:06 docsdrwxr-xr-x 3 mysql mysql 4096 Aug 8 04:06 includedrwxr-xr-x 5 mysql mysql 4096 Aug 8 04:06 libdrwxr-xr-x 4 mysql mysql 4096 Aug 8 04:06 man-rw-r--r-- 1 mysql mysql 2478 Jun 22 22:13 READMEdrwxr-xr-x 28 mysql mysql 4096 Aug 8 04:06 sharedrwxr-xr-x 2 mysql mysql 4096 Aug 8 04:06 support-files6.编辑参数文件
vim /etc/my.cnf[client]port = 3306socket = /tmp/mysql.sock[mysqld]server_id=10port = 3306user = mysqlcharacter-set-server = utf8mb4default_storage_engine = innodblog_timestamps = SYSTEMsocket = /tmp/mysql.sockbasedir = /usr/local/mysqldatadir = /mysql/datapid-file = /mysql/data/mysql.pidmax_connections = 1000max_connect_errors = 1000table_open_cache = 1024max_allowed_packet = 128Mopen_files_limit = 65535#####====================================[innodb]==============================innodb_buffer_pool_size = 1024Minnodb_file_per_table = 1innodb_write_io_threads = 4innodb_read_io_threads = 4innodb_purge_threads = 2innodb_flush_log_at_trx_commit = 1innodb_log_file_size = 512Minnodb_log_files_in_group = 2innodb_log_buffer_size = 16Minnodb_max_dirty_pages_pct = 80innodb_lock_wait_timeout = 30innodb_data_file_path=ibdata1:1024M:autoextendinnodb_undo_tablespaces=3#####====================================[log]==============================log_error = /mysql/log/mysql-error.log slow_query_log = 1long_query_time = 1 slow_query_log_file = /mysql/log/mysql-slow.logsql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES7.安装数据库
# ./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/mysql/data --innodb_undo_tablespaces=3 --explicit_defaults_for_timestamp8.配置启动文件
cp support-files/mysql.server /etc/init.d/mysqlchkconfig --add mysqlchkconfig mysql onservice mysql start9.配置环境变量
vi /etc/profile#for mysql mysql_home=/usr/local/mysqlPATH=$PATH:$mysql_home/binsource /etc/profile10.查看默认密码
grep -i password /mysql/log/mysql-error.log11.初始化密码
mysql -uroot -p‘xxxxx‘SET PASSWORD=PASSWORD(‘root‘);flush privileges;12.数据库常规启停
# mysqladmin -uroot -proot shutdown#mysqld_safe --defaults-file=/etc/my.cnf &#ps -ef|grep mysql13.安全配置
# mysql_secure_installation Securing the MySQL server deployment.Enter password for user root: VALIDATE PASSWORD PLUGIN can be used to test passwordsand improve security. It checks the strength of passwordand allows the users to set only those passwords which aresecure enough. Would you like to setup VALIDATE PASSWORD plugin?Press y|Y for Yes, any other key for No: yThere are three levels of password validation policy:LOW Length >= 8MEDIUM Length >= 8, numeric, mixed case, and special charactersSTRONG Length >= 8, numeric, mixed case, special characters and dictionary filePlease enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2Using existing password for root.Estimated strength of the password: 25 Change the password for root ? ((Press y|Y for Yes, any other key for No) : yNew password: Re-enter new password: Sorry, passwords do not match.New password: Re-enter new password: Sorry, passwords do not match.New password: Re-enter new password: Estimated strength of the password: 50 Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y ... Failed! Error: Your password does not satisfy the current policy requirementsNew password: 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) : yBy default, a MySQL installation has an anonymous user,allowing anyone to log into MySQL without having to havea user account created for them. This is intended only fortesting, and to make the installation go a bit smoother.You should remove them before moving into a productionenvironment.Remove anonymous users? (Press y|Y for Yes, any other key for No) : ySuccess.Normally, root should only be allowed to connect from‘localhost‘. This ensures that someone cannot guess atthe root password from the network.Disallow root login remotely? (Press y|Y for Yes, any other key for No) : ySuccess.By default, MySQL comes with a database named ‘test‘ thatanyone can access. This is also intended only for testing,and should be removed before moving into a productionenvironment.Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y - Dropping test database...Success. - Removing privileges on test database...Success.Reloading the privilege tables will ensure that all changesmade so far will take effect immediately.Reload privilege tables now? (Press y|Y for Yes, any other key for No) : ySuccess.All done!相关阅读:
Mysql在各个系统的安装教程
Mysql 5.7.19 免安装版配置方法教程详解(64位)
Mysql 5.7.19 免安装版遇到的坑(收藏)
MySQL 5.7.19安装目录下创建my.ini文件的方法
总结
以上所述是小编给大家介绍的mysql 5.7.19 二进制最新安装,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
A、MySQL备份工具xtrabackup的安装1.percona官方xtrabackup的二进制版本;二进制版本解压就能用了。2.解压xtrabackup&创
最新在学习MySQL,纯新手,对Linux了解的也不多,因为是下载的最新版的MySQL(MySQL5.7.18)二进制包,CentOS7.2下测试安装,方便以后
Mysql二进制安装方法下载mysqlhttps://dev.mysql.com/downloads/mysql/1.解压包tarxfmysql-5.7.24-
十进制256转换为二进制结果是100000000。十进制转换为二进制分为十进制整数转换为二进制整数和十进制小数转换为二进制小数,其中,十进制整数转换为二进制整数
使用mysql二进制方式连接您可以使用MySQL二进制方式进入到mysql命令提示符下来连接MySQL数据库。实例以下是从命令行中连接mysql服务器的简单实例