Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

Friday, August 10, 2012

MYSQL: Connect to mysql using command

How to connect to mysql using a command - from terminal

mysql -u <user> -p -h <host ip> -P <port> <dbname>

Example:

mysql -u root -p -h priyankgandhi.com -P 3306 testdb

Tuesday, May 1, 2012

XAMPP: How to change default language for phpmyadmin

Today I installed XAMPP. After installing, First thing I wanted to do was change mysql password. After searching on xampp site, I found out I can change mysql password using phpMyAdmin. (Ref: link) When I went to phpMyAdmin, everything was in German. After some search, I found out that you have to add two lines in config file.
C:\xampp\phpMyAdmin\config.inc.php
In this file add following line.
$cfg['DefaultLang'] = 'en-utf-8';
After this just reload phpmyadmin page.

Friday, July 15, 2011

MYSQL: Change mysql db schema name

How to change mysql database schema name?

Here s what you need to do:
1. Use mysqldump to dump old mysql database.
2. Create new database using mysqladmin.
3. And run the sql generated via mysqldump.

e.g. if you want to change database named "school_old" to "school_new"
Here are the commands.
mysqldump -u username -p -v school_old > old_db_dump.sql
mysqladmin -u username -p create school_new
mysql -u username -p school_new < old_db_dump.sql

Wednesday, July 29, 2009

Installing and configuring mysql on ubuntu

Open terminal.

Enter following commands.

$ sudo apt-get install mysql-server mysql-client
$ mysql_secure_installation

First command will install mysql server and client both.
Second command is not required butif you want to make your database more secure, it is helpful.
Default port for mysql is 3306. If you wish to change this, you can do so by editing mysql configuration (my.cnf) file which is located under /etc/mysql.

$ sudo vi /etc/mysql/my.cnf

Look for string port=3306
Update it to your desired port number.
Once you save my.cnf file, you will have to restart mysql server to effect your changes.
You can use following command (remove curly brackets) to start,stop or restart mysql server.

$ service mysql {start|stop|restart}