linux 安装 mysql

假装没事ソ 提交于 2020-02-19 12:48:48

 MySQL

按照以下的顺序进行执行

 再次查看发现已经没有 mysql-libs 的安装文件

官网下载地址:   https://downloads.mysql.com/archives/community/

 

 

确保系统中有 libaio 包

./mysqld --initialize --user=mysql --datadir=/var/lib/mysql --explicit_defaults_for_timestamp

 

 lo0dj.jpOM_w

记住上面的的密码;

可能会出现这种情况。 

 

vim /etc/my.cnf

 

# For advice 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]

# 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 = /usr/local/mysql
#mysql数据库文件夹所在位置
 datadir = /var/lib/mysql
#mysql数据库的数据文件所在位置
# port = .....

 datadir = /var/lib/mysql
#mysql数据库的数据文件所在位置
# port = .....
# server_id = .....
 socket = /var/lib/mysql/mysql.sock
#mysql sock位置

# 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 
 character-set-server=utf8
#修改mysql服务器默认的字符集

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

[client]

socket = /var/lib/mysql/mysql.sock
default-character-set=utf8

./mysql -u root -p

 #################################mysql 可能需要和 php 配置使用,进行配置###############################

在文件末尾添加内容 

#######################################################
PATH=$PATH:/usr/local/mysql/bin
export PATH

 

 ld.so.conf  的内容如下

include ld.so.conf.d/*.conf
/usr/local/mysql/lib

ldconfig通常在系统启动时运行,而当用户安装了一个新的动态链接库时,就需要手工运行这个命令。

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!