MySQL

Godaddy Backup Database Drupal

Backup Database for Drupal on Godaddy Web Hosting.

 

This most important thing for CMS abse web site is their database, without them you lost your site... this drupal site currently hosting on Godaddy, so this is the step by step procedure that i use to backup drupal database.

1. Login to Godaddy.

Login godaddy

2. Go to your hosting & Server -> point and click My Hosting Account.

Godaddy hosting account

3. Open hosting Control Panel for your drupal site, that the one youwant to make database bacup.

Open hosting account control panel

4. Select Manage Database.

select manage database


Select and working with MySQL database.

  Sometimes you have lot of database on your MySQL server, this list of database could be so many, but you just need to work with one of these database. This article show step by step to select and start working with the database.

1.  Login and connect to you MySQL database:

 # mysql -u root -p

 

2.  List all MySQL database available on the server:

 mysql> SHOW DATABASE;

 

3.. Choose the database that you want to work with:

 mysql> USE mysql-database-name;

 

Wink This example show that we change and start working with the current database that named 'mysql-database-name';

SealedPlease change the 'mysql-database-name' with the database that you want to work with.


Display list of database on MySQL server.

This article show step to display the list of database that available on your MySQL database server. This is command is quite useful if you have lot of database on your server and you want to list all of them.

1. Log in to MySQL server, make sure that you have sufficient privilages to list all database available on your MySQL:

[root@tenouk ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 70 to server version: 5.0.27
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>

2. To list all database on your MySQL sever:

mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| databasename |
| jmtidb |
| mysql |
| test |
+--------------------+
5 rows in set (0.00 sec)

mysql>

 

The database shown on these example are named information_schema, databasename, jmtidb, mysql and test.


Start, stop and auto start MYSQL server on Fedora Core Linux.

 

   When configuring MYSQL server or MYSQLd, sometimes you need to stop then need to restart the MYSQL server. In Linux environment you can use several command to start and stop the MySQL server, below is some example of the command that is executed and tested on fedora operating system.

 

Using service command to start or stop MySQL server:


1. To stop Mysqld:

[root@fedora ~]# service mysqld stop

Stopping MySQL:                                     [ OK ]


-- Execute the same command again to verify that your MySQLd stop --


[root@fedora ~]# service mysqld stop


Setup and configure MYSQL database server on Fedora Core.

The step by step procedure below is show the setup procedure and the configuration of MYSQL database server (MSQLd) on Fedora Core 6 operating system.

[root@tenouk ~]# mysqladmin -u dba_user -p create databasename
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!

1. If the error message above appear, this could mean that you MYSQL sever is not in service, you need to start the mysqd server on your fedora core server. Try the service command to start mysqld as in example below:.

[root@tenouk ~]# service mysqld start
Initializing MySQL database: Neither host 'tenouk.jmti.gov.my' nor 'localhost' could be looked up with
/usr/bin/resolveip
Please configure the 'hostname' command to return a correct hostname.
If you want to solve this at a later stage, restart this script with
the --force option
[FAILED]
2. If the error above appear, these mean that the hosts file is not configure properly. If the same error happen, use the step below to configure your server hosts file: If NOT proceed to step 3.


Change root password for mysqld on Fedora Core.

The article below show step by step procedure how to change the current root password for MYSQLd (MYSQL server). This procedure can be done only when you know the current root password for MSQLd server; The step by step command below execute and tested on Fedora Core 6 using Ver 14.12 Distrib 5.0.27.

[root@tenouk ~]# mysql --user=root --pass mysql

Enter password: [Enter your MYSQL root password here, then hit enter key]

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A


Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1 to server version: 5.0.27


Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

[Use and executet MYSQL command below and put your new password for MYSQL root user]

mysql> update user set Password=PASSWORD('your-new-mysql-password') WHERE User='root';

Query OK, 2 rows affected (0.01 sec)

Rows matched: 2 Changed: 2 Warnings: 0

[To apply changes make sure you execute the command below]

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)


Setting MYSQL database privilages for user

To use MySQL database you need to give your user permission (privallages) to access and edit the database.

The example below give full privillages to user to edit and acces the database.

1. Log in to mysql with the user that have full permission .

[root@bakawali ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1408 to server version: 5.0.22

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


2. To Grand All privillages to database user.

mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'database_user'@'localhost' IDENTIFIED BY 'user_password';
Query OK, 0 rows affected (0.07 sec)


3. To apply the changes execute this command

To activate the new permissions, enter the following command:
FLUSH PRIVILEGES;

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.05 sec)


4. To exit the mysql database

mysql> exit
Bye
[root@bakawali ~]#

 


 

NOTE: Below is the examle to grant specific privillages to the mysql database

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON database_name.* TO 'database_user_name'@'localhost' IDENTIFIED BY 'user_password';


Create new database on MySQL

To create a new database on MySSQL server please make sure that the MySQL server is install properly and mysqld server is started. The example below is executed on shell prompt on Feodra Core 5 Operating System.

Command syntax: mysqladmin -u dba_user -p create databasename

Note: The dba_user is the user that have privilage to create database on your MySQL server and the databasename is the name for your new database.

Command example:

[root@fedoracore ~]# mysqladmin -u root -p create newdb

Note: The command example above create new database named newdb and it's created by root user.

 


Custom Search

Syndicate content