Linux下安装Mysql
                        
                            时间:2021-07-01 10:21:17
                            帮助过:30人阅读
							                        
                     
                    
                    
                    //dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[mysqld]
#skip-grant-
tables
# 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
datadir=/usr/local/mysql/
data
port=
3306
#server_id=
socket=/var/lib/mysql/
mysql.sock
log-error=/usr/local/mysql/data/
error.log
pid-
file=/usr/local/mysql/
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 
 
(7) 初始化数据库
./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/ --pid-file=/usr/local/mysql/mysql.pid 
(8) 添加服务到etc目录
cp support-files/mysql.server /etc/init.d/mysql
(9) 启动服务
service mysql start
 (10)修改相关连接配置
进入到 /usr/local/mysql/bin目录 执行 ./mysql -h127.0.0.1 -uroot -p

执行相关密码权限操作

 连接数据库时,注意用自己配置的密码。 同时,如果是阿里云服务器,要修改安全组规则,添加出规则和入规则。
 
Linux下安装Mysql
标签:ant   bin   rem   select   dev   art   setting   group   pid