sábado, 7 de noviembre de 2015

Checking MySQL server status

You can use
mysqladmin
 to check the status of the MySQL server via the
ping
switch. The command looks like this:
mysqladmin -p ping

viernes, 6 de noviembre de 2015

killing mysql conection

1) check the active process

mysqladmin processlist -p12342


kill it by the iD

mysqladmin kill <id>

example :

mysqladmin -p kill 14

Setting an administrator password for MySQL

The syntax for setting the password with
mysqladmin
is as follows:



1)mysqladmin -u root password ‘newpassword’

2)mysqladmin -u root -p password ‘mY$qL53’   // if pass has been set

Enter password:

3) mysqladmin -u root -h hostname -p password ‘password’  //network



checkig mysql process and conection

 mysqladmin processlist -p1234
+----+------+-----------+----+---------+------+-------+------------------+
| Id | User | Host      | db | Command | Time | State | Info             |
+----+------+-----------+----+---------+------+-------+------------------+
| 57 | root | localhost |    | Query   | 0    |       | show processlist |
+----+------+-----------+----+---------+------+-------+------------------+

conecting to a remote mysql server

 mysql  -u root -p12345 -h 65.181.121.10

checking mysqld default configuration

root@asterisk-dominicana:~# my_print_defaults mysqld
--user=mysql
--pid-file=/var/run/mysqld/mysqld.pid
--socket=/var/run/mysqld/mysqld.sock
--port=3306
--basedir=/usr
--datadir=/var/lib/mysql
--tmpdir=/tmp
--lc-messages-dir=/usr/share/mysql
--skip-external-locking
--key_buffer=16M
--max_allowed_packet=16M
--thread_stack=192K
--thread_cache_size=8
--myisam-recover=BACKUP
--query_cache_limit=1M
--query_cache_size=16M
--log_error=/var/log/mysql/error.log
--expire_logs_days=10
--max_binlog_size=100M

Disabling remote conection to MYSQL

add  this line skip-external-locking to the  mysqld configuration on /etc/mysql/my.cnf and comment
#bind-address           = 0.0.0.0


[mysqld]
#
# * Basic Settings
#
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking


#bind-address           = 0.0.0.0


then restart mysql  :  /etc/init.d/mysql restart