Centos Linux7 源代码安装Mysql8.0 (最好用的方法)9

挂载之后,可以看到此LV的容量。

如果要在系统启动的时候启动LV,最好是将lvData写入fstable 文件中,如下所示:


使用Vim编辑器,打开/etc/fstab,在最后一行添加如图中所示,其中/dev/VolGroupdb/lvData指定需要挂载的分区LV/usr/local/mysqldb指定要挂载的目录(挂载点),ext4分区文件系统格式,其它使用默认即可

 

又再次执行cmake 、make ,make install 的过程

 

[root@mysql80 ~]# cd /usr/local/

[root@mysql80 local]# ls

gcc-5.3.0 gmp-4.3.2 mpc-0.8.1 mpfr-2.4.2 mysql8 mysql-8.0.19 mysqldb

[root@mysql80 local]# chown -R mysql:mysql /usr/local/mysql8

[root@mysql80 local]# chown -R mysql:mysql /usr/local/mysqldb

[root@mysql80 local]#

Mv mysql-8.0.19 /usr/local/mysqldb/

Cd /usr/local/mysqldb/mysql-8.0.19

 

 

cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql8 -DMYSQL_DATADIR=/usr/local/mysqldb -DSYSCONFDIR=/etc -DMYSQL_TCP_PORT=3306 -DWITH_BOOST=/usr/local/mysql8/mysql-8.0.19/boost -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DENABLED_LOCAL_INFILE=ON -DWITH_INNODB_MEMCACHED=ON -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 -DFORCE_INSOURCE_BUILD=1

 

 

查看/usr/local/mysql8目录

 

十四、编辑/etc/my.cnf ( 如果没有则创建)

[root@mysql57 mysql]# cd /etc

[root@mysql57 etc]# mv my.cnf my.cnf.bak

[root@mysql57 etc]# vi my.cnf

[root@mysql57 etc]#

[root@mysql57 etc]# cat my.cnf

[client]

port = 3306

socket = /tmp/mysql.sock

 

[mysqld]

port = 3306

socket = /tmp/mysql.sock

user = mysql

 

 

basedir = /usr/local/mysql8

datadir = /usr/local/mysqldb

pid-file = /usr/local/mysqldb /mysql.pid

 

log_error = /usr/local/mysqldb /mysql-error.log

slow_query_log = 1

long_query_time = 1

slow_query_log_file = /usr/local/mysqldb /mysql-slow.log

 

 

skip-external-locking

key_buffer_size = 32M

max_allowed_packet = 1024M

table_open_cache = 128

sort_buffer_size = 768K

net_buffer_length = 8K

read_buffer_size = 768K

read_rnd_buffer_size = 512K

myisam_sort_buffer_size = 8M

thread_cache_size = 16

query_cache_size = 16M

tmp_table_size = 32M

performance_schema_max_table_instances = 1000

 

explicit_defaults_for_timestamp = true

#skip-networking

max_connections = 500

max_connect_errors = 100

open_files_limit = 65535

 

log_bin=mysql-bin

binlog_format=mixed

server_id = 232

expire_logs_days = 10

early-plugin-load = “”

 

default_storage_engine = InnoDB

innodb_file_per_table = 1

innodb_buffer_pool_size = 128M

innodb_log_file_size = 32M

innodb_log_buffer_size = 8M

innodb_flush_log_at_trx_commit = 1

innodb_lock_wait_timeout = 50

 

[mysqldump]

quick

max_allowed_packet = 16M

 

[mysql]

no-auto-rehash

 

[myisamchk]

key_buffer_size = 32M

sort_buffer_size = 768K

read_buffer = 2M

write_buffer = 2M

 

 

以上配置内容非必须,可依据实际情况,做相应的调整!

以下文章点击率最高

Loading…

     

如果这文章对你有帮助,请扫左上角微信支付-支付宝,给于打赏,以助博客运营

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注