linux 安装 mysql

 MySQL

按照以下的顺序进行执行

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

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

官网太慢了电脑经常打不开,打开了也没法操作

可以登录中国科学技术大学开源软件镜像进行下载

http://mirrors.ustc.edu.cn/mysql-ftp/Downloads/MySQL-5.7/

确保系统中有 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

set password = password ('123456'); 

 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;

创建一个 root 用户,用于全部权限,任何ip 都能够连接该数据库,密码为123456, 

 

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

在文件末尾添加内容 

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

 

 ld.so.conf  的内容如下

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

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

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值