Articles of mysql

在CentOS / RHEL上增加nproc

我有一个问题,mysqld用尽线程,并在重负载时抛出错误。 我已经追溯到一个问题,那就是pid似乎限制了1024个进程的软限制(为了提高可读性,删除了其他限制): [root@db1 limits.d]# cat /proc/`pidof mysqld`/limits Limit Soft Limit Hard Limit Units Max processes 1024 191967 processes 我在/etc/security/limits.d/中有一个名为99-mysql.conf的文件,其中包含: mysql soft nofile 20000 mysql hard nofile 20000 mysql soft nproc 20000 mysql hard nproc 20000 据我所见,问题来自用户启动的MySQL。 我没有testing过这个,但是我假设如果MySQL在系统启动的时候启动,那么它应该有正确的限制。 有没有办法增加这个pid和未来mysqld进程的nproc的软限制?

MySQL连接中止 – 我应该担心吗?

我正在优化Apache和mod_php的networking服务器上的MySQL,所以我跑了mysqltuner ,结果如下: ——– General Statistics ————————————————– [–] Skipped version check for MySQLTuner script [OK] Currently running supported MySQL version 5.1.63-0+squeeze1 [OK] Operating on 64-bit architecture ——– Storage Engine Statistics ——————————————- [–] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster [–] Data in MyISAM tables: 255M (Tables: 120) [–] Data in InnoDB tables: 5M (Tables: 2) [!!] […]

MySQL的 – MySQL的主数据库密码的变化是否影响奴隶分贝?

我想更改主数据库上的MySQL数据库密码。 我的问题是:当更改主数据库密码时,我们是否必须关心从DB?

mysql不能在日志表中使用锁

当我在Debian MySQL 5.1中运行mysqlcheck命令时,我得到以下消息: Debian:~# mysqlcheck –all-databases -u root -p Enter password: mysql.columns_priv OK mysql.db OK mysql.event OK mysql.func OK mysql.general_log Error : You can't use locks with log tables. status : OK mysql.help_category OK mysql.help_keyword OK mysql.help_relation OK mysql.help_topic OK mysql.host OK mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK mysql.servers OK mysql.slow_log Error : […]

在bash脚本中执行根mysql操作

在bash脚本中执行mysql数据库的根操作的最佳做​​法是什么? 例如,我想创build新的数据库和授予权限,我必须使用: mysql -u $ROOT -p"$ROOTPASS" -e "create database $DBNAME; GRANT ALL PRIVILEGES ON $DBNAME.* T $DBUSER@localhost IDENTIFIED BY $DBPASS"; 但是这需要在脚本本身中存储root用户的mysql密码。 有没有更安全的方法? 我应该为此创build单独的用户吗? 如何设置权限? 单独的事情是如何testing操作是否成功,如果不成功,则恢复成功的更改(事务?)

Keepalived负载平衡MySQL。 备份服务器超时

亲爱的在ServerFault的人。 我试图(和失败)build立一个负载均衡的MySQL服务器arrays。 请赐教,告诉我在我的方式错误。 当前的设置:两个具有专用固定IP(10.116.219.47和10.116.219.48)的MySQL服务器和一个使用keepalived(10.116.219.12)共享的虚拟IP。 此设置可成功提供故障转移。 如果closuresDB1服务器,DB2服务器将迅速接pipe。 只有在configuration中添加虚拟服务器块时,事情才会中断。 DB1 vrrp_instance VI_2 { state MASTER interface eth0 virtual_router_id 60 priority 150 advert_int 1 authentication { auth_type PASS auth_pass 3S83hbt200SbwY6 } virtual_ipaddress { 10.116.219.12 } } DB2 vrrp_instance VI_2 { state BACKUP interface eth0 virtual_router_id 60 priority 100 advert_int 1 authentication { auth_type PASS auth_pass 3S83hbt200SbwY6 } virtual_ipaddress […]

后缀 – Dovecot – 可以发送电子邮件,但不会收到 – NOQUEUE – 中继访问被拒绝

我在Ubuntu上build立了一个邮件服务器。 我查了端口打开,我已经双重检查所有的configuration文件,检查每一个谷歌search结果,我可以find。 大多数类似的post有更复杂的日志和我已经采取的大纲步骤。 我可以从我的服务器发送电子邮件没有问题,但我不能接收它们。 尝试从我的大学电子邮件和我的gmail电子邮件中收到电子邮件后,这里是邮件日志: Jan 3 19:02:03 li740-32 postfix/smtpd[19816]: connect from mail-by2on0070.outbound.protection.outlook.com[207.46.100.70] Jan 3 19:02:04 li740-32 postfix/smtpd[19816]: NOQUEUE: reject: RCPT from mail-by2on0070.outbound.protection.outlook.com[207.46.100.70]: 454 4.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<na01-by2-obe.outbound.protection.outlook.com> Jan 3 19:02:04 li740-32 postfix/smtpd[19816]: disconnect from mail-by2on0070.outbound.protection.outlook.com[207.46.100.70] Jan 3 19:02:32 li740-32 postfix/smtpd[19816]: connect from mail-vc0-f178.google.com[209.85.220.178] Jan 3 19:02:33 li740-32 postfix/smtpd[19816]: NOQUEUE: […]

Sysbench MySQL无法连接

我创build了一个名为sbtest的用户,没有密码,对sbtest具有所有权限,并且发生以下错误。 我究竟做错了什么? $ sysbench –test=oltp run –debug sysbench 0.4.12: multi-threaded system evaluation benchmark No DB drivers specified, using mysql DEBUG: mysql_init(0xc854f0) DEBUG: mysql_real_connect(0xc854f0, "localhost", "sbtest", "(null)", "sbtest", 3306, "(null)", CLIENT_MULTI_STATEMENTS) DEBUG: mysql_real_query(0xc854f0, "SHOW TABLE STATUS LIKE 'sbtest'", 31) = 0 DEBUG: mysql_store_result(0xc854f0) = 0xc9dce0 DEBUG: mysql_num_fields(0xc9dce0) = 18 DEBUG: mysql_fetch_fields(0xc9dce0) = 0xc9fce0 DEBUG: mysql_fetch_row(0xc9dce0) = […]

软件包mysql-server-5.6尚未configuration

我在Ubuntu 15.10上安装了MySQL 5.6的一个问题。 基本上加载数据库服务器由于上述原因失败。 mysql-server depends on mysql-server-5.6; however: Package mysql-server-5.6 is not configured yet.

GTID已被closures但我有复制错误

我只是从mariadb5升级到mariadb10。 然后我有我的奴隶复制错误 无法从mysql.gtid_slave_pos加载复制GTID从属状态:表'mysql.gtid_slave_pos'不存在 我的这个复制主没有使用GTID,为什么会出现这个错误。 虽然我有这个错误我的slave_IO和slave_SQL仍在运行。 这是我的奴隶地位供参考 *************************** 1. row ******************** ******* Slave_IO_State:等待主控发送事件 Master_Host:172.19.19.149 Master_User:从属 Master_Port:3306 Connect_Retry:10 Master_Log_File:mysql-bin.000385 Read_Master_Log_Pos:564 Relay_Log_File:migrate-relay-bin.000002 Relay_Log_Pos:535 Relay_Master_Log_File:mysql-bin.000385 Slave_IO_Running:是的 Slave_SQL_Running:是的 Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno:1146 Last_Error:无法从mysql.gtid_slave_pos加载复制GTID从属状态:表'mysql.gtid_slave_pos'不存在 Skip_Counter:0 Exec_Master_Log_Pos:564 Relay_Log_Space:834 Until_Condition:无 Until_Log_File: Until_Log_Pos:0 Master_SSL_Allowed:否 Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master:0 Master_SSL_Verify_Server_Cert:否 Last_IO_Errno:0 Last_IO_Error: Last_SQL_Errno:1146 Last_SQL_Error:无法从mysql.gtid_slave_pos加载复制GTID从属状态:表'mysql.gtid_slave_pos'不存在 Replicate_Ignore_Server_Ids: Master_Server_Id:30 Master_SSL_Crl: Master_SSL_Crlpath: Using_Gtid:不 Gtid_IO_Pos: […]