MariaDB資料庫存放路徑修改配置問題

來源:互聯網
上載者:User

MariaDB資料庫存放路徑修改配置問題

MySQL is not running, but lock file (/var/lock/subsys/mysql) exists
存在這個問題的一般是由三個原因決定的:
1:配置中的一些檔案許可權不夠,將所有的配置中涉及到的檔案全部修改為mysql使用者權限
2:mysql啟動並執行pid沒有,rm -rf /var/lock/subsys/mysql ,重新建立新的pid檔案預設的許可權為660
3:my.cnf設定檔錯誤,需要重新修改

Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
這個問題是由於myql存放檔案中沒有系統內建的資料庫可以輸入mysql_install_db
或者將資料庫的路徑重新修改為預設的/var/lib/mysql的目錄下面

下面貼出我自己的mariadb的配置(從資料庫)

[client]
port            = 3306
socket          = /var/lib/mysql/mysql.sock
default-character-set=utf8


[mysqld_safe]
socket          = /var/lib/mysql/mysql.sock
nice            = 0


[mysqld]
user  = mysql
pid-file  = /var/run/mysqld/mysqld.pid
socket  = /var/lib/mysql/mysql.sock
log_error  =  /var/log/mysqld/error.log
port  = 3306
basedir  = /usr
datadir  = /data
tmpdir  = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
bind-address = 0.0.0.0
skip-name-resolve
lower_case_table_names = 1
max_connections = 1000
connect_timeout = 15
wait_timeout = 600
max_allowed_packet      = 16M
thread_cache_size      = 128
sort_buffer_size        = 16M
bulk_insert_buffer_size = 16M
tmp_table_size          = 128M
max_heap_table_size    = 128M
query_cache_limit    = 0
query_cache_size    = 0


long_query_time = 10


log_bin                = /var/log/mysqld/mysql-bin
log_bin_index          = /var/log/mysqld/mysql-bin.index


expire_logs_days        = 10
max_binlog_size        = 100M


binlog_ignore_db=mysql
server_id=5005
log_slave_updates=1
slave_skip_errors=all
#auto_increment_offset=1
###auto_increment_increment=2
#binlog_format=row
#
##
##replicate-do-db=
#key_buffer_size = 1024M
##
#
#collation-server = utf8_general_ci
#init-connect='SET NAMES utf8'
#character-set-server = utf8
#
#default_storage_engine  = InnoDB
#innodb_buffer_pool_size = 30720M
#innodb_log_buffer_size  = 32M
#innodb_file_per_table  = 1
#innodb_open_files      = 400
#innodb_io_capacity      = 400
#innodb_flush_method    = O_DIRECT
#innodb_flush_log_at_trx_commit = 2
#innodb_log_file_size    = 512M
#
#key_buffer              = 16M
#thread_stack            = 192K
#myisam-recover        = BACKUP
#
#[mysqldump]
#quick
#quote-names
#max_allowed_packet      = 16M
#
#[isamchk]
#key_buffer              = 16M
##

Linux系統教程:如何檢查MariaDB服務端版本 

MariaDB Proxy讀寫分離的實現

Linux下編譯安裝配置MariaDB資料庫的方法

CentOS系統使用yum安裝MariaDB資料庫

安裝MariaDB與MySQL並存

Ubuntu 上如何將 MySQL 5.5 資料庫遷移到 MariaDB 10 

[翻譯]Ubuntu 14.04 (Trusty) Server 安裝 MariaDB 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.