MySQL – Server Gigabit Guide https://www.servergigabit.com/guide VPS Hosting | Dedicated Server Sat, 23 Sep 2023 15:38:57 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.2 https://www.servergigabit.com/guide/wp-content/uploads/2020/07/cropped-GIGABIT_logo-1-32x32.png MySQL – Server Gigabit Guide https://www.servergigabit.com/guide 32 32 Backup/restore MySQL databases from cPanel https://www.servergigabit.com/guide/kb/backup-restore-mysql-databases-from-cpanel Mon, 08 Jun 2020 19:45:00 +0000 https://www.wesbytes.com/guide/?post_type=kb&p=2157 Steps to backup the MySQL database, please do the following: 1.Login to your control panel and click Backups. 2.Under Download a MySQL Databases Backup, click the name of the databases. 3.Click Save As. 4.Select a destination for where you would like the backup to be saved, locally. Once you have a backup, if you ever inadvertently lose your data, then…

The post Backup/restore MySQL databases from cPanel appeared first on Server Gigabit Guide.

]]>
Steps to backup the MySQL database, please do the following:

1.Login to your control panel and click Backups.

2.Under Download a MySQL Databases Backup, click the name of the databases.

3.Click Save As.

4.Select a destination for where you would like the backup to be saved, locally.

Once you have a backup, if you ever inadvertently lose your data, then you can restore the database easily and quickly.

To restore a database, please do the following:

1.Login to your control panel and click Backups.

2.Click the Browse button next to the option which says Restore a MySQL Database.

3.Select the .sql.gz file which you want restored.

4.Click the Open button and click the Upload button.

You’ve successfully completed the steps to Backup MySQL database from cPanele.If you found this guide useful during the setup of your additional address. Please share it with other users going through the same process.

 

Please refer to the following article to know more. 
Knowledge Base: Database using Mysqldump

 

The post Backup/restore MySQL databases from cPanel appeared first on Server Gigabit Guide.

]]>
Database using Mysqldump https://www.servergigabit.com/guide/kb/database-using-mysqldump Mon, 08 Jun 2020 19:44:44 +0000 https://www.wesbytes.com/guide/?post_type=kb&p=2156 Below are mysqldump commands for backup and restore mysql database: WINDOWS: Backup: C:\mysql\bin> mysqldump -u username -p password database > dumbfile.sql Restore: C:\mysql\bin>mysql -u username -p password database < dumpfile.sql UNIX / LINUX Method A (followed by the user database username and password) ======= Backup: mysqldump -u username -p password database > dumbfile.sql Restore: mysql -u username -p password database < dumbfile.sql…

The post Database using Mysqldump appeared first on Server Gigabit Guide.

]]>
Below are mysqldump commands for backup and restore mysql database:

WINDOWS:

Backup:
C:\mysql\bin> mysqldump -u username -p password database > dumbfile.sql

Restore:
C:\mysql\bin>mysql -u username -p password database < dumpfile.sql


UNIX / LINUX

Method A (followed by the user database username and password)
=======
Backup:

mysqldump -u username -p password database > dumbfile.sql

Restore:
mysql -u username -p password database < dumbfile.sql

Method B (backup and restore with root access)
========
Backup:
mysqldump databasename > dumpfile.sql

Restore:
mysql newdatabasename < dumpfile.sql

Backup:
Notes:
– dumbfile.sql contains SQL command for creating tables and data. (CREATE,INSERT,DROP etc.)

If you found this guide useful during the backup. Please share it with other users going through the same process.

 

Please refer to the following article to know more. 
Knowledge Base: MySQL Trigger and View

 

The post Database using Mysqldump appeared first on Server Gigabit Guide.

]]>
MySQL Trigger and View https://www.servergigabit.com/guide/kb/mysql-trigger-and-view Mon, 08 Jun 2020 19:44:21 +0000 https://www.wesbytes.com/guide/?post_type=kb&p=2154 MySQL Trigger.  The MySQL trigger is a database object that is associated with a table. It will be activated when a defined action is executed for the table. The trigger can be executed when you run one of the following MySQL statements on the table: INSERT, UPDATE and DELETE. It can be invoked before or after the event which means…

The post MySQL Trigger and View appeared first on Server Gigabit Guide.

]]>
MySQL Trigger. 

The MySQL trigger is a database object that is associated with a table. It will be activated when a defined action is executed for the table. The trigger can be executed when you run one of the following MySQL statements on the table: INSERT, UPDATE and DELETE. It can be invoked before or after the event which means it can be schedule to run at certain time.

View.

A view works like a table, but it is not a table. It never exists; it is only a prepared SQL statement that is run when you reference the view name.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

MySQL creates a temporary table based on the view definition statement and then executes the incoming query on this temporary table.

First, MySQL combines the incoming query with the query defined the view into one query. Then, MySQL executes the combined query

Both of the properties above can be granted by using the “MySQL Database Wizard” in the cPanel control panel while you can also grant the privilege for the user to a specific database on Website Panel control panel as well by using the “Database manager” option. You may refer below on how to enable the trigger and view on cPanel:

1. Click on the “MySQL” option.MySQL-MySQL Databases

2. Click on the database username shown at the “Privileged Users” column.MySQL-Privileged users-manage Privileges

3. Select the required privilege needed to be given to the database as per below.MySQL-All Privileges

4. Click on the “Make Changes” button to save the privilege assigned.

5. Done!

 

Please refer to the following article to know more. 
Knowledge Base: How to change all MySQL database table collation

The post MySQL Trigger and View appeared first on Server Gigabit Guide.

]]>
How to change all MySQL database table collation https://www.servergigabit.com/guide/kb/how-to-change-all-mysql-database-table-collation Mon, 08 Jun 2020 19:41:40 +0000 https://www.wesbytes.com/guide/?post_type=kb&p=2153 After change the collation of a database, only the new tables will be created with the new collation. To change all the database collation, you can use the php script as below as it can change all the collation for all the existing table. <?php $db = mysql_connect(‘localhost’,’database_user‘,’Password‘); if(!$db) echo “Cannot connect to the database – incorrect details”; mysql_select_db(‘database_name‘); $result=mysql_query(‘show tables’);…

The post How to change all MySQL database table collation appeared first on Server Gigabit Guide.

]]>
After change the collation of a database, only the new tables will be created with the new collation. To change all the database collation, you can use the php script as below as it can change all the collation for all the existing table.

<?php
$db = mysql_connect(‘localhost’,’database_user‘,’Password‘);
if(!$db) echo “Cannot connect to the database – incorrect details”;
mysql_select_db(‘database_name‘); $result=mysql_query(‘show tables’);
while($tables = mysql_fetch_array($result)) {
foreach ($tables as $key => $value) {mysql_query(“ALTER TABLE $value COLLATE Collation“);
}}
echo “The collation of your database has been successfully changed!”;
?>

Note: 
database_user : Database Username
Password: Database user password
database_name: Database Name
Collation : new collation

You’ve successfully completed the steps to change the database table collation.If you found this guide useful during the setup of your additional address. Please share it with other users going through the same process.

 

Please refer to the following article to know more. 
Knowledge Base: How to delete MySQL database in WebsitePanel

The post How to change all MySQL database table collation appeared first on Server Gigabit Guide.

]]>
How to delete MySQL database in WebsitePanel https://www.servergigabit.com/guide/kb/how-to-delete-mysql-database-in-websitepanel Mon, 08 Jun 2020 19:36:47 +0000 https://www.wesbytes.com/guide/?post_type=kb&p=2152 Delete MySQL database in WebsitePanel   This guide is for Windows hosting WebsitePanel users who want to delete their MySQL databases which no longer needed. Firstly, Enter your WebsitePanel Secondly, Click on Databases > MySQL 5.x. Click on the database you want to delete. Lastly, Select Delete to proceed.   Please refer to the following article to know more.  Knowledge…

The post How to delete MySQL database in WebsitePanel appeared first on Server Gigabit Guide.

]]>
Delete MySQL database in WebsitePanel

 

This guide is for Windows hosting WebsitePanel users who want to delete their MySQL databases which no longer needed.

  1. Firstly, Enter your WebsitePanel
  2. Secondly, Click on Databases > MySQL 5.x. MySQL database-WebsitePanel-MySQL5.x
  3. Click on the database you want to delete.MySQL database-WebsitePanel-SQL Database Properties-delete
  4. Lastly, Select Delete to proceed.

 

Please refer to the following article to know more. 
Knowledge Base: How to optimize your MySQL databases?

 

The post How to delete MySQL database in WebsitePanel appeared first on Server Gigabit Guide.

]]>
How to optimize your MySQL databases https://www.servergigabit.com/guide/kb/how-to-optimize-your-mysql-databases Mon, 08 Jun 2020 19:29:34 +0000 https://www.wesbytes.com/guide/?post_type=kb&p=2151 Steps to optimize your MySQL databases Databases is one of the important entities for the website to work normally. There is also some times that the required database may some times take up to many resources which may leads to the website to down or either showing error below is on how to optimize your databases to help your website…

The post How to optimize your MySQL databases appeared first on Server Gigabit Guide.

]]>
Steps to optimize your MySQL databases

Databases is one of the important entities for the website to work normally. There is also some times that the required database may some times take up to many resources which may leads to the website to down or either showing error below is on how to optimize your databases to help your website system to work normally.

Step 1: Login to phpMyAdmin

cPanel: (Shared, Reseller, SEO, Linux Dedicated, VPS with cPanel)

Login to cPanel

– Click on the phpMyAdmin button in the Databases section.

– Plesk 10: (Windows Shared, Windows Dedicated, VPS with Plesk)

Login to Plesk

– Click on the Websites & Domains tab.

– Next, Click on the Databases icon.

– Click on the database you want to manage.

– Lastly, Click on the Webadmin icon.

Step 2: Optimize Tables

On the left side of phpMyAdmin, you’ll see a list of databases:

  1. Select your database from the list.
    In the center panel, a list of your tables appears:
    optimize your MySQL databases-list of tables
  2. Look at the ‘Overhead’ column to the far right – if you see any numerical values, those tables can be optimized. In the example above, only those tables have been selected.
  3. At the bottom of your table list, click the ‘With selected’ dropdown menu.Optimize MySQL databases-dropdown menu
  4. From the dropdown menu, select ‘Optimize table’.
    The optimization may take time to complete depending how large the database is. Once it completes, the page displays the query that was run along with a success message:
    Optimize MySQL databases-selesct-optimize databses
  5.  Done to optimize MySQL databases.

 

Please refer to the following article to know more. 
Knowledge Base: How to update MySQL Database user privilege

The post How to optimize your MySQL databases appeared first on Server Gigabit Guide.

]]>
How to update MySQL Database user privilege https://www.servergigabit.com/guide/kb/how-to-update-mysql-database-user-privilege Mon, 08 Jun 2020 19:04:10 +0000 https://www.wesbytes.com/guide/?post_type=kb&p=2124 This article will show the steps on how you manage the database user privilege, update MySQL Database. 1) Login into your server’s cPanel and look for the category “Databases”. Click the “MySQL@Databases”. 2) Click on the database user under the ” Current Databases ” section table. 3) Manage and update the MySQL User privileges by tick or untick on the…

The post How to update MySQL Database user privilege appeared first on Server Gigabit Guide.

]]>
This article will show the steps on how you manage the database user privilege, update MySQL Database.

1) Login into your server’s cPanel and look for the category “Databases”. Click the “MySQL@Databases”.MySQL database-cPanel-MySQL Database

2) Click on the database user under the ” Current Databases ” section table.MySQL database-cPanel-current databases

3) Manage and update the MySQL User privileges by tick or untick on the small boxes. MySQL database-cPanel-Manage User Privileges

4) Click ” Make Changes ” to save it and you’re sucessfully update MyQSL user privilege.MySQL database-cPanel-Make changes

 

 

Please refer to the following article to know more. 
Knowledge Base: What is the port does MySQL use?

The post How to update MySQL Database user privilege appeared first on Server Gigabit Guide.

]]>
What is the port does MySQL use? https://www.servergigabit.com/guide/kb/what-is-the-port-does-mysql-use Mon, 08 Jun 2020 18:53:34 +0000 https://www.wesbytes.com/guide/?post_type=kb&p=2123 We have never change the MySQL port and the port is still uses back the default port. Our MySQL uses Port 3306 where you could connect through MySQL Administration Tools, Navicat, etc.       Please refer to the following article to know more.  Knowledge Base: Connection Strings for MySQL      

The post What is the port does MySQL use? appeared first on Server Gigabit Guide.

]]>
We have never change the MySQL port and the port is still uses back the default port.

Our MySQL uses Port 3306 where you could connect through MySQL Administration Tools, Navicat, etc.

 

 

 

Please refer to the following article to know more. 
Knowledge Base: Connection Strings for MySQL

 

 

 

The post What is the port does MySQL use? appeared first on Server Gigabit Guide.

]]>
Connection Strings for MySQL https://www.servergigabit.com/guide/kb/connection-strings-for-mysql Mon, 08 Jun 2020 18:53:14 +0000 https://www.wesbytes.com/guide/?post_type=kb&p=2122 Connection Strings for MySQL Cold Fusion (DNSless): connectstring=”Driver={MySQL ODBC 3.51 Driver};SERVER=serverIP;UID=user;PWD=pass;DATABASE=mydb;network=dbmssocn” OR connectstring=”Driver={MySQL ODBC 5.1 Driver};SERVER=serverIP;UID=user;PWD=pass;DATABASE=mydb;network=dbmssocn” Cold Fusion (DNS): datasource=”DSN” username=”user” password=”pass” Perl (DSNless): $dbh = DBI->connect(‘dbi:mysql:mydatabase:serverIP’,’user’,’pass’); PHP (DSNless): $db = mysql_connect(“serverIP”, “user”, “pass”) ASP (DSN): MyConn.Open “dsn” ASP (DSNless): “Driver={MySQL ODBC 3.51 Driver};” & _ “Server=serverIP;” & _ “Port=3306;” & _ “Option=131072;” & _ “Stmt=;” & _ “Database=mydatabase;” &…

The post Connection Strings for MySQL appeared first on Server Gigabit Guide.

]]>
Connection Strings for MySQL

Cold Fusion (DNSless):
connectstring=”Driver={MySQL ODBC 3.51 Driver};SERVER=serverIP;UID=user;PWD=pass;DATABASE=mydb;network=dbmssocn”

OR

connectstring=”Driver={MySQL ODBC 5.1 Driver};SERVER=serverIP;UID=user;PWD=pass;DATABASE=mydb;network=dbmssocn”

Cold Fusion (DNS):
datasource=”DSN” username=”user” password=”pass”

Perl (DSNless):
$dbh = DBI->connect(‘dbi:mysql:mydatabase:serverIP’,’user’,’pass’);

PHP (DSNless):
$db = mysql_connect(“serverIP”, “user”, “pass”)

ASP (DSN):
MyConn.Open “dsn”

ASP (DSNless):
“Driver={MySQL ODBC 3.51 Driver};” & _
“Server=serverIP;” & _
“Port=3306;” & _
“Option=131072;” & _
“Stmt=;” & _
“Database=mydatabase;” & _
“Uid=user;” & _
“Pwd=pass”

 

Please refer to the following article to know more. 
Knowledge Base: Does your server support MySQL Front?

The post Connection Strings for MySQL appeared first on Server Gigabit Guide.

]]>
Does your server support MySQL Front? https://www.servergigabit.com/guide/kb/does-your-server-support-mysql-front Mon, 08 Jun 2020 18:52:47 +0000 https://www.wesbytes.com/guide/?post_type=kb&p=2121 The answer is “Yes”, our Windows and Linux server do support MySQL Front through Port 3306. However external IP has to be set up in CPanel (linux) in order to connect using MySQL Front. The steps outlined as below. 1) Login to CPanel > Remote MySQL 2) Enter your external IP and press Add Host 3) You could obtain your…

The post Does your server support MySQL Front? appeared first on Server Gigabit Guide.

]]>
The answer is “Yes”, our Windows and Linux server do support MySQL Front through Port 3306.

However external IP has to be set up in CPanel (linux) in order to connect using MySQL Front. The steps outlined as below.

1) Login to CPanel > Remote MySQL

2) Enter your external IP and press Add Host

3) You could obtain your external IP by: http://myip.dk

4) The IP have to be updated if using dynamic IP address once restarted ISP connection.

The post Does your server support MySQL Front? appeared first on Server Gigabit Guide.

]]>