2021-01-15 MariaDB非yum安装-二进制安装

网友投稿 760 2022-12-01

2021-01-15 MariaDB非yum安装-二进制安装

2021-01-15  MariaDB非yum安装-二进制安装

一定要注意版本!!!

MariaDB -

- 安装

解压文件到/usr/local/ 此目录不能更改

tar

进入 /usr/local

cd

创建软链接

ln

创建mariadb目录并添加用户

mkdir -p /TRS/APP/mariadbuseradd

给mysql用户授权,进入/usr/local/mysql目录

chown -R mysql .chgrp -R mysql .chown

创建配置文件目录

mkdir

创建日志目录

mkdir

MariaDB 配置

创建配置文件

此处注意版本问题:10.3.7的conf文件应该放到/etc/my.conf

通过运行脚本查看当前版本配置文件应该存放的路径,或者可以修改脚本

脚本目录:/etc/init.d/mysqld 164行左右,如下图:

/usr/local/mysql/

vim /etc/my-f

[client]port = 3306#mysql.sock目录socket = /TRS/APP/mariadb/mysql.sock[mysqld]user = mysqlport=3306default-storage-engine = InnoDB#目录socket = /TRS/APP/mariadb/mysql.sockskip-external-lockingcharacter-set-server = utf8max_allowed_packet = 16Mmax_connect_errors=65535skip_name_resolve = ONsysdate-is-now = 1innodb = FORCE#数据库目录datadir = /TRS/APP/mariadblog-bin = /var/lib/mysql/mysql-binauto_increment_increment=2auto_increment_offset=2log-slave-updates=on#relay_log_recovery = 1binlog_format=mixed #rowmax_binlog_size=1024Mbinlog_cache_size = 2Mexpire-logs-days = 14server-id = 189sync-binlog = 1query-cache-type = 0query-cache-size = 0max_connections=8192thread-cache-size = 1024open_files_limit=8192table-definition-cache = 1024table-definition-cache = 1024max_prepared_stmt_count=200000slow_query_log=on#日志慢加载slow_query_log_file=/TRS/APP/mariadb/logs/mysql-slow.loglog-error = /TRS/APP/mariadb/logs/mysql.loglog-queries-not-using-indexes = 1long_query_time = 1interactive_timeout = 1728000wait_timeout = 1728000lower_case_table_names=1innodb-log-file-size = 512Minnodb-flush-log-at-trx-commit = 2innodb-file-per-table = 1innodb-buffer-pool-size = innodb_log_buffer_size = 8Minnodb_lock_wait_timeout = 150replicate-ignore-db = mysqlreplicate-ignore-db = information_schemareplicate-ignore-db = performance_schemamax_heap_table_size = 2048Mtmp_table_size = 2048M#innodb-log-files-in-group = 2[mysqldump]quickmax_allowed_packet = 512M[mysql]no-auto-rehash[isamchk]key_buffer = 20Msort_buffer_size = 20Mread_buffer = 2Mwrite_buffer = 2M[myisamchk]key_buffer = 20Msort_buffer_size = 20Mread_buffer = 2Mwrite_buffer = 2M[mysqlhotcopy]

启动脚本

运行生成数据库脚本

./bin/mysql_install_db --user=mysql

复制运行脚本

cp

启动mysqld

service

启动数据库

cd

运行mysql

./mysql -uroot -p

问题

找不到在mysql 目录下找不到mariadb的conf配置文件 自己创建配置文件并粘贴内容不同版本脚本指定的路径有些差异,需要进入脚本查看,脚本目录: cat /etc/init.d/mysqld

cat

两种解决方法:

修改脚本文件文件为你的目录修改你的my-f路径为脚本指向文件

FATAL ERROR: Could not find ./bin/my_print_defaults的解决办法 回到mysql目录执行脚本/bin/mysqld: Can’t create file ‘/TRS/APP/mariadb/logs/mysql.log’ (errno: 13 “Permission denied”) 权限问题c

chown

Installation of system tables failed! Examine the logs in /TRS/APP/mariadb/logs/mysql.log or /TRS/APP/mairadb/data for more information. 查看日志发现异常:

mysqld: File ‘/var/lib/mysql/mysql-bin.index’ not found (Errcode: 2 “No such file or directory”)

修改配置文件InnoDB: mmap(137035776 bytes) failed; errno 12 2021-01-15 11:14:49 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool 2021-01-15 11:14:49 0 [ERROR] InnoDB: Database creation was aborted with error Gener 没有足够的内存,将内存的缓冲内存调低

innodb-buffer-pool-size =

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER ! 未启动数据库,etc/init.d/mysqld: line 264: kill: (6910) - No such process [FAILED] 脚本指向的conf存在问题

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:manual make usb installer for windows in ubuntu15.04
下一篇:使用springboot单元测试对weblistener的加载测试
相关文章

 发表评论

暂时没有评论,来抢沙发吧~