Kurinchi Blogger Scribbles …


Archive for the ‘MySql’ Category

Sep 18
2011

MySQL: ‘Access denied for user ‘root’@'localhost’ (using password: YES)’

Last updated: September 18th, 2011

The above error message most likely occurs when users change password in one environment (via command line or phpmyadmin) and do not see the changes reflect in other OR if they have forgotten the password that is being set for the environment in question.

Following command should help you set/change MySQL password

$ mysql -u root -p
(more…)

Aug 10
2011

MySQL: How to stop, start or restart mysql?

Last updated: August 10th, 2011

In linux, following commands are used to start/stop/restart mysql

$/etc/init.d/mysqld start
$/etc/init.d/mysqld restart
$/etc/init.d/mysqld stop

In windows, mysql runs as a service.
C:> net stop mysql
C:> net start mysql

Jul 20
2011

Linux: Case sensitive MySQL table names

Last updated: August 10th, 2011

When transitioning MySQL database from Windows to Linux, users often encounter issues related to case-sensitiveness. Windows is case-insensitive and Linux is case-sensitive.

In such scenarios when a database call is made after the application migration happens, users often run into errors which can send them in circles between the migration servers.

Solution to this problem is to add a single line of text under my.cnf (MySQL configuration file) under [mysqld] (more…)

Mar 26
2011

MySQL: Default collation latin1_swedish_ci (swedish case insensitive)

Last updated: March 26th, 2011

When new fileds are created as variable characters they get stored as latin1_swedish_ci as default. To change the default collation users will have to manually select the collation of their choice from the mysql admin interface such as in the case of phpmyadmin or will have to denote it in sql queries.

To make a specific collation as the default, other option to give mysql an indication of it by having the needed collation name in my.cnf (mysql configuration) as shown below

Edit my.cnf:
[mysqld]
collation_server=latin1_general_ci

(more…)

Jan 09
2011

MySQL Database Error: Error 28 from Storage engine

Last updated: January 9th, 2011

Reason for the error is the availability of space allocated to the MySQL database in the specified partition.

Easy fix for this is to go to the PhpMyAdmin interface (via CPanel/WHM) and identify the tables which has some value in under overhead column. Select ALL those tables and choose the option “Repair table” after you ensure that there is enough space in the database.

May 20
2010

MySQL GUI tool for Data Management

Last updated: May 20th, 2010

HeidiSQL - a comprehensive tool for MySQL management which is available for Free.

Manage data tables, export/import databases, synchronise tables between databases, integrity check, database backup service management, edit database content and many more features packaged as a solution for ALL your MySQL needs.

This runs on windows platforms – WinXP/XP7 and you can download HeidiSQL from Download link
(more…)

Apr 28
2010

Backup Types

Last updated: April 28th, 2010

Full backup
Full backup is process of backing up ALL data.
First step towards all other types of backup
Backup time will be longer
Restore operation takes less time

Differential backup
Differential backup is the process of backing up data that has changed since the last FULL backup.
Requires file maintenance as the backup file will be of similar size or larger than its previous backup
Longer backup time than incremental backup
Faster restoration than incremental backup

Incremental backup
Incremental backup is the process of backing up data that has changed since the last Full, Incremental or Differential backup
Takes lesser backup time as it will have small data to archive
Takes longer restoration time

Mirror backup
Mirror backup is similar to full backup and is a direct copy of the files/folders
Files are not compressed in zip files and are not protected with password. They remain the mirror or exact copy of the source.

Apr 05
2010

How to import mysql dump (.gz or .sql) into a database?

Last updated: April 6th, 2010

When moving mysql database from one server to another or, to test that the data backup works as expected we need to import mysql dump file in the testing environment.

Create the database (test-database) in the testing environment and identify the location of the .gz or .sql file.

If the mysql dump was a .gz file, you need to gunzip to uncompress the file by typing
$ gunzip mysqldump.sql.gz

This will uncompress the .gz file and will just store mysqldump.sql in the same location.
(more…)

Mar 12
2010

Ubuntu: Configure PHPMyAdmin in Simple Steps

Last updated: March 17th, 2010

$ sudo apt-get install phpmyadmin

For versions 7.10 and up, choose “Apache 2″ from the screen “Configuring phpmyadmin”

If everything goes fine, you can access phpmyadmin from
http://servername/phpmyadmin

If you have created users in MySQL, you can use those credentials to log into the database. The basic admin account is “admin” with no password.

Phpmyadmin defaults to requiring you to login after 1800 seconds of inactivity.

» MySQL Create User, Grant Rights http://kurinchilamp.kurinchilion.com/2009/04/mysql-create-user-grant-rights.html

Feb 05
2010

MySQL: Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’

Last updated: February 5th, 2010

Reason why this error might occur:

i) Incomplete MySQL implementation
ii) MySQL setting mis-configuration

Solution:

root@myserver:/# vi /etc/mysql/my.cnf

Comment out the below line in my.cnf file to make MySQL listen on ALL interfaces
#bind-address = 127.0.0.1

root@myserver:/# netstat -tap | grep mysql
tcp 0 0 *:mysql *:* LISTEN 17785/mysqld

Note that above line which indicates MySQL listening on all interfaces.


Valid HTML 4.01 Strict  Valid HTML 4.01 Strict