Browsing articles tagged with "mysql - Admins Goodies"
Jan 23, 2013
tom

Making a mysql dump causes web application to hang.

Can the following command on a live server mysqldump -h XXXX -u root -pXXXXX –skip-opt –flush-privileges –flush-logs –routines –triggers –allow-keywords –create-options –add-locks –quick –single-transaction –extended-insert –all-databases cause a web application (which relies on databases of server) to hang? Asked by Alex Some possibilities: MyISAM tables only support table-level locking, so while your mysqldump is reading the table, any writes will be queued up until it’s finished. If a write gets queued, any other reads will [...]

Continue Reading »
Jan 23, 2013
tom

MySQL Error – Can’t connect to local MySQL server through socket

Sometimes on my VPS I get the error Warning: mysql_pconnect(): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111) in /var/www/mysql.php on line 8 It can be solved by restarting MySQL several times, restating the sever or sometimes using mysqld command. Using the mysqld command I get the following: root@web:~# mysqld 130109 10:47:23 [Note] Plugin ‘FEDERATED’ is disabled. 130109 10:47:23 InnoDB: The InnoDB memory heap is disabled 130109 10:47:23 InnoDB: Mutexes and rw_locks use [...]

Continue Reading »
Jan 21, 2013
tom

Incrementing values, alternate way of doing this that won’t use MySQL

I need to count impressions of a .php script that is accessed via web. Right now I do this in a 1 line MySQL table and just increment the value. This works fine usually but when the server has traffic bursts (hundreds of requests/second) everything gets delayed and the increment SQL statements start to pop up in MySQL’s slow queries log. I tried to count via APC but it “loses” values, that is, when I [...]

Continue Reading »
Jan 20, 2013
tom

How can I make mysql recognize root user after install?

I just installed MySQL 5.5 and right after install I was asked to set root password by executing those two commands: /usr/bin/mysqladmin -u root password ‘new-password’ /usr/bin/mysqladmin -u root -h linux-opxd password ‘new-password’ or /usr/bin/mysql_secure_installation I executed first command — OK. I executed second command this time with error: error: ‘Access denied for user ‘root’@’localhost’ (using password: NO)’ I re-executed the first one (for checking) — error as above. So, I executed mysql_secure_installation. Everything went [...]

Continue Reading »
Jan 9, 2013
tom

MySQL won’t start after creating sym link to data directory

I’ve moved all the stuff in /var/lib/mysql to /500gb/mysql, and created a symbolic link from one to the other. I then did a chown mysql:mysql and chmod 777 (with both -h and -R as necessary) to both the /var/lib/mysql symbolic link, and also /500gb/mysql. ls -al /var/lib gives me: lrwxrwxrwx 1 mysql mysql 15 2011-07-27 12:55 mysql -> /500gb/mysql When I try to start MySQL (service mysql start), I get the following in /var/log/mysql/error.log: 110727 [...]

Continue Reading »
Jan 9, 2013
tom

MySQL reinstall questions

For some reason my /var/run/ dir on debian6 had it’s chown and chmod changed. Problem is from what? Outcome is that mysql fails. I’m guessing the easiest way to fix is to reinstall MySQL. (Previously this LAMP was running fine.) However, I have established databases and tables and don’t want to lose them. Since mysql is not running I can’t backup (correct?). I just want to confirm that: 1). if I reinstall, I won’t loose [...]

Continue Reading »
Jan 1, 2013
tom

Passing Arguments to a Service started with Init.d

I want to start mysql with the command argument “–log=log_file_name” What is the proper way to do that when starting it with /etc/init.d? Would it be like this? /etc/init.d/mysql start –log=log_file_name Asked by Jim To make it simple you can create another entry in init.d to start the mysql with that logdir path option. Make a script like /etc/init.d/mysql-log and put following entries in it: #!/bin/sh -e set -e COMMAND=$1 LOG=”–log=/tmp/mysql.log” case $COMMAND in start) [...]

Continue Reading »
Dec 22, 2012
tom

Redirect MySQL queries to another server

I want to use another server to store my databases, so how can I redirect MySQL queries to another server? Asked by Zim3r You can use something like mysql proxy link1 link2 for it. But it’s not very well supported. Additionally, decrease in performance is somewhat significant. If possible, I would suggest you to simply tell your application to connect to the actual mysql server with a choice. For example, with PHP, there is mysqlnd_ms [...]

Continue Reading »
Dec 21, 2012
tom

How to check if MySQL replication is using SSL

I have a MySQL (actually mariaDB) install that I just started replicating to another server. I want to ensure that I’ve setup SSL correctly. The SSL portion of SHOW SLAVE STATUS looks like: Master_SSL_Allowed: Yes Master_SSL_CA_File: /etc/mysql/newcerts/ca-cert.pem Master_SSL_CA_Path: /etc/mysql/newcerts/ Master_SSL_Cert: /etc/mysql/newcerts/client-cert.pem Master_SSL_Cipher: Master_SSL_Key: /etc/mysql/newcerts/client-key.pem Seconds_Behind_Master: 0 Master_SSL_Verify_Server_Cert: No Is this typical or show that replication is using SSL? Is there something else I can check to ensure it’s using SSL? The slave is successfully replicating. [...]

Continue Reading »
Dec 17, 2012
tom

Installing mysqlnd for php 5.4.9 on CentOs 6.3

Okay let me get straight to the point, I am a complete noob, and have never done stuff like this at all, I have read tutorial after tuorial but I cant get anything to work. When I tried to install the rpm file I got this error rpm -Uvh ftp://ftp.pbone.net/mirror/rpms.famillecollet.com/enterprise/6/test/x86_64/php-mysqlnd-5.4.9-1.el6.remi.x86_64.rpm Retrieving ftp://ftp.pbone.net/mirror/rpms.famillecollet.com/enterprise/6/test/x86_64/php-mysqlnd-5.4.9-1.el6.remi.x86_64.rpm warning: /var/tmp/rpm-tmp.ez4vvd: Header V3 DSA/SHA1 Signature, key ID 00f97f56: NOKEY error: Failed dependencies: php-pdo(x86-64) = 5.4.9-1.el6.remi is needed by php-mysqlnd-5.4.9-1.el6.remi.x86_64 so I tried [...]

Continue Reading »
Pages:1234567...186»