《MysqL教程Linux下安装MysqL5.7.19问题小结》要点:
本文介绍了MysqL教程Linux下安装MysqL5.7.19问题小结,希望对您有用。如果有疑问,可以联系我们。
MysqL数据库第一次在自己虚机上安装MysqL 中间碰到很多问题 在这里记下来,分享一下.
MysqL数据库MysqL版本 MysqL-5.7.19-linux-glibc2.12-x86_64.tar.gz
MysqL数据库1、groupadd MysqL
## 添加一个MysqL组
MysqL数据库2、useradd -r -g MysqL MysqL
## 添加一个用户
MysqL数据库3、解压缩下载的包,tar -xzvf /usr/local/MysqL-5.7.13-linux-glibc2.5-x86_64.tar.gz
MysqL数据库4、mv /usr/local/MysqL-5.7.13-linux-glibc2.5-x86_64 /usr/local/MysqL
##重命名
MysqL数据库5、mkdir /usr/local/MysqL/data
## 默认是没有这个文件夹得 用来放数据
MysqL数据库6、chown -R MysqL:MysqL ./
##进入MysqL包中,给这个包授权 给MysqL
MysqL数据库7、chgrp -R MysqL:MysqL ./
##进入MysqL包中
MysqL数据库8、bin/MysqLd --initialize --user=MysqL --basedir=/usr/local/MysqL --datadir=/usr/local/MysqL/data
##进入MysqL文件名 basedir 为MysqL 的路径,datadir 为MysqL的 data 包,里面 存放着MysqL自己的包,如user
MysqL数据库网上很多教程MysqL_install_db
方式安装的,我刚开始也是这么安装,各种报错、失败,MysqL_install_db 命令不推荐、按上面的命令来就好
MysqL数据库此处需要注意记录生成的临时密码,如上文:YLi>7ecpe;YP
MysqL数据库9、bin/MysqL_ssl_rsa_setup --datadir=/usr/local/MysqL/data
MysqL数据库10、进入MysqL support-file
MysqL数据库11、cp my-default.cnf /etc/my.cnf
MysqL数据库这个是时候我们自己创建一个(内部代码如图): 重点下面两个socket(红色)对应的值必须一致,不然启动以后链接不上
MysqL数据库 #dvice on how to change settings please see # http://dev.MysqL.com/doc/refman/5.7/en/server-configuration-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] sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES # 一般配置选项 basedir = /usr/local/MysqL datadir = /usr/local/MysqL/data port = 3306 #socket = /temp/MysqLd.sock socket = /var/run/MysqLd/MysqLd.sock character-set-server=utf8 #下面是可选项,要不要都行,如果出现启动错误,则全部注释掉,保留最基本的配置选项,然后尝试添加某些配置项后启动,检测配置项是否有误 back_log = 300 max_connections = 3000 max_connect_errors = 50 table_open_cache = 4096 max_allowed_packet = 32M #binlog_cache_size = 4M max_heap_table_size = 128M read_rnd_buffer_size = 16M sort_buffer_size = 16M join_buffer_size = 16M thread_cache_size = 16 query_cache_size = 128M query_cache_limit = 4M ft_min_word_len = 8 thread_stack = 512K transaction_isolation = REPEATABLE-READ tmp_table_size = 128M #log-bin=MysqL-bin long_query_time = 6 server_id=1 innodb_buffer_pool_size = 1G innodb_thread_concurrency = 16 innodb_log_buffer_size = 16M innodb_log_file_size = 512M innodb_log_files_in_group = 3 innodb_max_dirty_pages_pct = 90 innodb_lock_wait_timeout = 120 innodb_file_per_table = on [MysqLdump] quick max_allowed_packet = 32M [MysqL] no-auto-rehash socket = /var/run/MysqLd/MysqLd.sock default-character-set=utf8 safe-updates [myisamchk] key_buffer = 16M sort_buffer_size = 16M read_buffer = 8M write_buffer = 8M [MysqLhotcopy] interactive-timeout [MysqLd_safe] open-files-limit = 8192 [client] loose-default-character-set = utf8
MysqL数据库12、cp MysqL.server /etc/init.d/MysqL
MysqL数据库13、vim /etc/init.d/MysqL
##修改basedir= 自己的路径 修改datadir= 自己的路径
MysqL数据库14、bin/MysqLd_safe --user=MysqL
& ## 启动MysqL
MysqL数据库13、./MysqL -uroot -p
##bin目录下
MysqL数据库此时MysqL只有本地localhost可以访问
MysqL数据库以上所述是小编给大家介绍的Linux下安装MysqL5.7.19问题小结,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的.在此也非常感谢大家对编程之家PHP网站的支持!