Basic MySQL commands

ARUN Posted in MYSQL
0

Check the below URL :

http://admin.webhostingdevelopment.com/viewtopic.php?f=108&t=115&p=130#p130

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) + cpanel jailed shell

ARUN Posted in ERROR, MYSQL
0

Getting the error “ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)” while I try to connect to mysql via a jailed shell enabled user.

[email protected] [~]# mysql
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)
[email protected] [~]#

Solution :

http://admin.webhostingdevelopment.com/viewtopic.php?f=84&t=74
You need to specify the hostname so you can connect.
mysql -h=127.0.0.1 -u user_name -p
or
mysql -h=localhost -u user_name -p

Account Creation Status: failed (Sorry, a mysql user with the name + already exists

ARUN Posted in MYSQL, WHM BACKEND, WHM FRONTEND
0

This mainly happens if you terminated a cpanel account and somehow the MySQL user was not deleted properly.

Solution :  Try deleting the mentioned user.

Delete the user :

mysql

mysql > use mysql;

mysql > drop user testusr7@localhost;

OR

mysql> delete from mysql.user where user=’testusr7′;

You can aslo check this using :

select User, Host from user where User like ‘%testusr7%’;

 

Now try restoring/recreating whatever you were trying to do and see if you still receive the error.

If yes do

grep testusr7 /var/cpanel/databases/users.db

grep testusr7 /etc/dbowners

If the user exist in the above files, delete that and try again.

OR

create a cpanel user with name “testusr7777″.

Modify account and rename that to “testusr7″

Terminate the account from WHM

It fixed for me!!!

How to reset mysql user password in linux through command prompt

ARUN Posted in MYSQL
0

Login to mysql.

mysql -u root -p

In mysql prompt use

mysql> use mysql;

Now change the password for user “arun”   to  “secret123″ as below :

[    mysql> update user set password=PASSWORD("secret123") where User='arun';     ]

 

Repair all mysql database on a server

ARUN Posted in MYSQL
0

mysqlcheck -Ar

How to install and configure phpmyadmin for remote database access

ARUN Posted in MYSQL
0

Download and install the phpmyadmin as :

cd /usr/local/apache/htdocs

wget  http://iweb.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.4.4/phpMyAdmin-3.4.4-english.tar.gz

tar -xzvf phpMyAdmin-3.4.4-english.tar.gz

chown nobody:nobody phpMyAdmin-3.4.4-english -R

cd phpMyAdmin-3.4.4-english

In browser open Ip/phpMyAdmin-3.4.4-english/setup

Give the required fields in the first page. Save and quit.

 

 

 

 

 

 

 

How to reset mysql root password in linux centos

ARUN Posted in MYSQL
0

/etc/init.d/mysqld stop

[  mysqld_safe --skip-grant-tables &  ]

mysql -u root

use mysql;

update user set password=PASSWORD(“YOUR_ROOT_PW”) where User=’root’;

Above command can be used to reset plesk admin password as well.

flush privileges;

quit

/etc/init.d/mysqld stop

/etc/init.d/mysqld start

mysql -u root -p

Mysql database wont show up in cpanel after a migration.

ARUN Posted in MYSQL
0

Solution that worked for me :

UPDATED perl
/scripts/checkperlmodules –force
UPCP to stable version…(Didnt fix)
Ran upcp in release version. (FIXED here)
Changed to stable and ran upcp and everything worked fine for me.

Also check the /var/lib/mysql to make sure all dbs have correct naming e.g. there is no folder there like someuser_somedb.bak

Mysql tuner

ARUN Posted in MYSQL
0

cd /usr/local/src/

wget mysqltuner.pl

perl mysqltuner.pl

Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) [2002]

ARUN Posted in MYSQL
0

Getting the following error on mysql sites and also when trying to access mysql from server

============

Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) [2002]

============

Solution :

vi /etc/my.cnf

skip-innodb

Try to restart mysql and if it dont start then use   killall -9 mysqld

After that restart mysql

Forcing InnoDB Recovery

ARUN Posted in MYSQL
0
In my.cnf add
[mysqld]
innodb_force_recovery = 4

Mysql settings summary

ARUN Posted in MYSQL
0

root@server [/]# mysqladmin variables

How to clear the brute force database

ARUN Posted in ATTACK, MYSQL
0

When you are blocked by brute force try the below command to clear the database.

SSH to server

mysql -u user -p

mysql> connect cphulkd;

mysql> select IP, BRUTETIME from brutes order by BRUTETIME;

mysql> delete from brutes;

phpmyadmin upload limitation

ARUN Posted in CPANEL FRONTEND, MYSQL, WHM BACKEND, WHM FRONTEND
0

To increase the phpmyadmin upload limitation in cpanel servers you can edit the php.ini file mentioned below :

vi /usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini.

upload_max_filesize = 100M

post_max_size = 100M

Even if you edit the main php.ini file it wont work in this case.

Cpanel >> phpmyadmin may not reflect the change, if so go to

WHM >> tweak settings >> cPanel PHP max POST size >> and increase the limit.

or

Increase WHM >> Tweak Settings >> cPanel PHP max upload size

The MySQL® server is currently offline.

ARUN Posted in MYSQL, WHM BACKEND, WHM FRONTEND
0

Getting error “The MySQL® server is currently offline.”  while trying to add database.

Solution :

WHM >> Reset Local MySQL Root Password