Posted by Rishikesh Vispute
Categories: mysql
How to enable mysql Query cache on linux server? Ans: You need to login to mysql by using root accesss. ========================== root@server[~]#mysql -u root –pPASSWORD mysql> SET GLOBAL query_cache_size = 16777216; (If you want to set query_cache_size=16 MB) ========================== Then open the my.cnf file and add the following directives. # vi /etc/my.cnf query_cache_size = 268435456 [ Read More ]
Posted by Rishikesh Vispute
Categories: mysql, Plesk
Error : ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES) Solution : To find password for user admin, run [root@server22 ~]# cat /etc/psa/.psa.shadow FfRBehWy [root@server22 ~]# To login to MySQL mysql -u admin -pFfRBehWy For example [root@server22 ~]# mysql -u admin -pFfRBehWy Welcome to the MySQL monitor. Commands end with ; or [ Read More ]
Posted by Rishikesh Vispute
Categories: mysql
Error : When you try to run the mysqldump command to make a backup of database then encounter the following error-exception: mysqldump databasename > databasename.sql mysqldump: Got error: 1016: Can’t open file: ‘./databasename/wp_142_term_taxonomy.frm’ (errno: 24) when using LOCK TABLES Solution: Open the file /etc/my.cnf and add the following line and restart the mysql service on [ Read More ]
Error : Your all database details is correct but the database is not connected in any application. Solution : The problem due the ” sql.safe_mode” is “On” in php.ini file. You need to turn off the sql.safe_mode in server php.ini file sql.safe_mode = Off Done
Database Connection by using jsp page . The URL based mysql connection is ================================= jdbc:mysql://serverip address/DATABASENAME?user=USERNAME&password=PASSWORD ================================= OR ================================= <!– Database connection settings –> <property name=”connection.driver_class”>com.mysql.jdbc.Driver</property> <property name=”connection.url”>jdbc:mysql://localhost/database_name</property> <property name=”connection.username”>databses_user</property> <property name=”connection.password”>password</property> <!– configuration pool via c3p0–> ================================= OR ================================= try { Class.forName(“com.mysql.jdbc.Driver”).newInstance(); // here we are connecting to localhost, port 3306. Change it to [ Read More ]
Posted by Rishikesh Vispute
Categories: mysql
If anyone has run into a situation where sql queries from your java app were erroring out because of letter case in tables and column names in MySQL database, I have a quick solution for you. First, what you should have done, but probably was too creative and used mixed case for creating table names/columns [ Read More ]
To login (from unix shell) use -h only if needed. # [mysql dir]mysql -u username -p Create a database on the sql server. mysql> create database [databasename]; List all databases on the sql server. mysql> show databases; Switch to a database. mysql> use [db name]; To see all the tables in the db. mysql> show [ Read More ]
Posted by Rishikesh Vispute
Categories: mysql
mysql_pconnect() will maintain a persistent connection to the database. Whenever your script calls the connect to database function, it first searches already existing connections to the database and if exists it will use the same connection to connect to the database, if not it will open a new connection to the database. ie. Connection is [ Read More ]
Posted by Rishikesh Vispute
Categories: mysql
Hosting Company ============================= DB_HOST Value Guess ====================== 1and1 db12345678 AN Hosting localhost BlueHost localhost DreamHost mysql.example.com GoDaddy h41mysql52.secureserver.net HostGator localhost HostICan localhost ICDSoft localhost:/tmp/mysql5.sock LaughingSquid localhost MediaTemple GridServer internal-db.s44441.gridserver.com one.com localhost pair Networks dbnnnx.pair.com Yahoo mysql Hosts with cPanel localhost Hosts with Plesk localhost Hosts with DirectAdmin ============================= localhost =======================
Posted by Rishikesh Vispute
Categories: mysql
Update to latest Mysql version provided by cpanel To upgrade the mysql on the cpanel server * The best method to use the cpanel #/script/mysqlup to upgrade the mysql. * To upgrade the mysql from 4.0.x to 4.1.x you need to enable the mysql upgrade in the whm under tweak setting /scripts/upcp –force /scripts/mysqlup –force
Posted by Rishikesh Vispute
Categories: mysql
How to connect to Database for any user through Server # mysql -u DBNAME -p DBPASS command for taking mysql backup:=> #mysqldump databasename > file.sql command for restoring : => # mysql -u [username] -p[password] [database] < [backup_file] or #mysql database name < file.sql