Databases - AwardSpace.com https://www.awardspace.com/kb/databases/ Free Web Hosting with PHP, MySQL, Email Sending, No Ads Thu, 17 Oct 2024 11:23:57 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.3 https://www.awardspace.com/wp-content/uploads/2022/09/awardspace-favicon-120x120.png Databases - AwardSpace.com https://www.awardspace.com/kb/databases/ 32 32 How can I access and log into phpMyAdmin? https://www.awardspace.com/kb/how-to-access-phpmyadmin/ Thu, 18 Feb 2021 16:04:15 +0000 https://www.awardspace.com/?p=48443 The database has become a vital part of modern websites. Many content management systems are also using the database to store their content there. We understand that database management is important to our users. This is why we offer a range of tools in our Database Manager. In this article, we will go explain to […]

The post How can I access and log into phpMyAdmin? appeared first on AwardSpace.com.

]]>
The database has become a vital part of modern websites. Many content management systems are also using the database to store their content there. We understand that database management is important to our users. This is why we offer a range of tools in our Database Manager. In this article, we will go explain to you how to access the phpMyAdmin.

 

What is phpMyAdmin?

PhpMyAdmin is a free open source tool used for the administration of MySQL and MariaDB databases. This is a web application written primarily in PHP and has become one of the most popular tools for managing MySQL databases.

 

How to access phpMyAdmin?

Accessing the phpMyAdmin is easy and can be done with a few clicks. To do that follow these steps:

  1. Log in to your hosting control panel
  2. Access the Database Manager from the Hosting Tools menu
  3. From there click the phpMyAdmin link under the Management column for the database which you would like to access
  4. Once you do that our system will automatically log you into the phpMyAdmin

You can also access the phpMyAdmin manually from the phpMyAdmin page here. After you have loaded the page enter your database username and password and click Go.

Be advised that the phpMyAdmin can be accessed only if you already have a database created via the Database Manager. You can read more about how to create a database and how to use the Database Manager from our article here.

The post How can I access and log into phpMyAdmin? appeared first on AwardSpace.com.

]]>
How to create a database? https://www.awardspace.com/kb/how-to-create-a-database/ Thu, 18 Feb 2021 15:57:52 +0000 https://www.awardspace.com/?p=48438 Databases are an important part of modern websites. They store all your website data (content, users, configuration). This is why we offer databases for all hosting plans, including the free plan. In this article, we will go through the process of database creation.   Creating a database on a shared plan When using our shared […]

The post How to create a database? appeared first on AwardSpace.com.

]]>
Databases are an important part of modern websites. They store all your website data (content, users, configuration). This is why we offer databases for all hosting plans, including the free plan. In this article, we will go through the process of database creation.

 

Creating a database on a shared plan

When using our shared hosting plans you will be able to create databases only from the Database Manager located in the Hosting Control Panel. The reason for this is due to the fact that you do not have root access to the server and you would not be able to send a command to the server that would create the database for you. This means that when manually installing an application that requires a database you would also have to manually create the database from the Database Manager.

 

How to create a database?

To do that you would first have to navigate to the Database Manager. The Database Manager can be found inside your Hosting Control Panel under the Hosting Tools menu. Once inside the Database Manager you will be presented with two options:

  • Create MySQL Database
  • Create PostgresSQL Database

Choose the database type that your website requires. After that, you will have to enter the name and the password for your database as shown in the picture below, and click Create Database.

 

Things you must know when creating a database

There are a couple of things you need to know before and after you create a database:

  1. The name of your database would always have your client ID as a prefix. For example, if your client ID is 123456 your database name will be 123456_database
  2. When you create a database a user is automatically created and assigned to it. The name of the username for your database would be the same as your database name. Following the above example, the username for the database 123456_database would be 123456_database
  3. You cannot create additional users for your database. Each database comes with one and only user which can manage it
  4. Our shared hosting database servers are running on separate servers. This means that when installing your application you will not be able to use localhost as a hostname for your database. Please make sure to check your Database Manager for the proper hostname
  5. Databases cannot be accessed remotely. You can only make changes to your database via a script uploaded to your hosting account or via the phpMyAdmin which can be accessed in the Database Manager

If you are having trouble with using our Database Manager you can look at our article here where we have described the section in detail.

The post How to create a database? appeared first on AwardSpace.com.

]]>
How Can I Reduce the Size of a MySQL Database? https://www.awardspace.com/kb/reduce-mysql-database-size/ Sat, 21 Mar 2020 20:23:09 +0000 https://www.awardspace.com/?p=45192 Database software, such as MySQL, often employs various techniques to speed up the searching and delivery of any information that is requested. In most cases, these techniques take the form of temporary databases that are created to serve as intermediates and help you retrieve the requested data faster. The only downside to these additional databases […]

The post How Can I Reduce the Size of a MySQL Database? appeared first on AwardSpace.com.

]]>
Database software, such as MySQL, often employs various techniques to speed up the searching and delivery of any information that is requested. In most cases, these techniques take the form of temporary databases that are created to serve as intermediates and help you retrieve the requested data faster. The only downside to these additional databases is that they will consume extra disk space. In this article, we will show you the various ways in which you can reduce your MySQL database size.

 

How Do I Lower the Size of a MySQL Database?

There are two broad approaches you can take to reduce the size of a MySQL database. You can either try optimizing the database structure or you can delete any unnecessary data. Below we will examine both techniques in greater detail.

 

How Does Optimization for a MySQL Database Work?

As we mentioned earlier, MySQL databases often create internal tables in an effort to speed up lookup queries. However, these additional tables become less effective over time as you add new data and change existing entries. As such, it is a good idea to optimize your database from time to time. Not only will you reduce the overall size of your database, but you are also likely to see a performance boost as well!

You have two options when it comes to optimizing a database on our shared hosting platform. You can either use our 1-click optimizer that is part of our Database Manager or you can go more hands-on using the tools provided by phpMyAdmin.

 

How Do I Optimize a MySQL Database Using the Database Manager?

You can easily and quickly optimize all tables in a given MySQL database thanks to the Database Manager section of our Control Panel. The Database Manager will be available to you if you are using our free website hosting, premium shared hosting, or one of our Semi-Dedicated web servers. To optimize your database, follow these steps:

  1. Go to the Database Manager section of our Control Panel.
  2. Click on the database name that you wish to optimize.
  3. Open the Management tab.
  4. Click on the option titled 1-click Optimization.
You can reduce your MySQL database size in a single click thank to the optimization option in our Database Manager.
You can reduce your MySQL database size in a single click thanks to the optimization option in our Database Manager.

Once you perform the above actions, all tables in your database will be optimized. Keep in mind that our database usage statistics are not updated in real-time, so you may not notice an immediate difference in database usage. To learn more about the various features our Database Manager has to offer, you may go through our complete guide to the Database Manager.

 

How Do I Optimize the Tables of a MySQL Database Using phpMyAdmin?

Unlike our Database Manager which optimizes all tables in one fell swoop, phpMyAdmin gives you much more granular control when it comes to which tables should be optimized and which tables should remain unchanged. Below we will examine two techniques for reducing table sizes through phpMyAdmin: the Optimize option as well as compressing data from tables that use the InnoDB storage engine.

In addition to table optimization, phpMyAdmin provides you with a plethora of other options that you might find useful. You can learn more about this handy utility in our phpMyAdmin overview.

 

How Do I Reduce My Table Size Using the Optimize Feature in phpMyAdmin?

Follow the steps below in order to optimize the tables in your MySQL database using the optimization function in phpMyAdmin:

  1. Open the Database Manager section of the Control Panel.
  2. Click on the database name that you wish to optimize.
  3. Open the Management tab.
  4. Click on the phpMyAdmin option as is shown below:
You can easily access the phpMyAdmin utility using a link in the Management tab of our Database Manager.
You can easily access the phpMyAdmin utility using a link in the Management tab of our Database Manager.
      • phpMyAdmin will now open in a new tab and you will be presented with the list of tables that comprise the database. Place checkmarks in front of the tables that you wish to optimize.
      • Once you have made your selection, choose the Optimize table option from the dropdown menu. The option is part of the Table maintenance section:
/wp-content/uploads/2020/03/reduce-mysql-database-size-3.png
          • Once you select the Optimize table command, it will be executed automatically and you should be presented with the Your SQL query has been executed successfully. message:
Success! The selected tables were optimized successfully.
Success! The selected tables were optimized successfully.

One thing to keep in mind is that the Optimize table option performs different actions depending on the storage engine that your tables are using. As such, the option’s effects can vary from table to table. This is especially true if you are utilizing different storage engines and if some of your tables undergo regular edits while other tables remain relatively unchanged.

 

How Do I Compress the Data in a MySQL Database?

As we have previously noted, different storage engines come with different feature sets. One standout feature of the InnoDB storage engine is its ability to compress your data without any loss of information. The compression is most effective if your tables have columns that use the TEXT, BLO, VARCHAR, and VARBINARYdata types.

To run the compression on a given table, you first need to make sure that the table in question is using the InnoDB storage engine. You can find this information in phpMyAdmin’s database structure view. This view is most easily accessed by clicking on your database name as is shown in the screenshot below:

Clicking on your database name in phpMyAdmin takes you to the structure view for your database.
Clicking on your database name in phpMyAdmin takes you to the structure view for your database.

Once you are in the structure view, you should see a list of all tables that are contained within your database. The column that shows your current storage engine is called Type and is highlighted below:

phpMyAdmin uses the not-so-obvious column heading Type to denote the storage engine each table is using.
phpMyAdmin uses the not-so-obvious column heading Type to denote the storage engine each table is using.

If you see InnoDB listed as the storage engine on the tables that you wish to compress, then you are good to go. If you see any other value, however, you would need to convert your table(s) to use the InnoDB storage engine first. The conversion is done by executing a short SQL command. To get started, switch to the SQL tab in phpMyAdmin:

The SQL tab in phpMyAdmin gives you the freedom to run any SQL commands that you need.
The SQL tab in phpMyAdmin gives you the freedom to run any SQL commands that you need.

Once there, paste the following code:

ALTER TABLE my_table ENGINE = InnoDB;

Be sure to replace my_table with the name of the table that you wish to convert. In our example, we are converting a table called orders, so our command would look like this:

ALTER TABLE orders ENGINE = InnoDB;

Once you have entered the command, click on the Go button in the lower-right corner to execute it. If successful, you should be presented with a success message as the one shown below:

You may see a different success message depending on the contents of your table, but in general, it should look similar to this one.
You may see a different success message depending on the contents of your table, but in general, it should look similar to this one.

If you wish to convert multiple tables to the InnoDB storage engine, you would need to run the above command for each of them.

Now that your tables are using InnoDB, you can proceed with the actual MySQL data compression. The compression itself is a short SQL command that also needs to be run from the SQL tab in phpMyAdmin. Here is the command:

ALTER TABLE my_table ROW_FORMAT=COMPRESSED;

Just like with the table conversion, you need to replace my_table with the actual name of your table. As an example, in the screenshot below we are compressing the table called orders:

MySQL data compression may sound complicated, but it is, in fact, a simple SQL command that you need to run.
MySQL data compression may sound complicated, but it is, in fact, a simple SQL command that you need to run.

Once you have entered the compression command, press the Go button to execute it. If you wish to compress multiple tables, you may do so by running the SQL command for each table.

If all goes well with the compression, phpMyAdmin should greet you with a success message similar to this one.
If all goes well with the compression, phpMyAdmin should greet you with a success message similar to this one.

 

How Do I Delete Tables Using phpMyAdmin?

Your other alternative when it comes to freeing up storage space is to remove data that you no longer need from your database. You can either delete individual entries or entire tables.

To delete a table, just go to the Structure tab for your database so you see all of your tables. From there, choose the Drop option next to the table you wish to delete and confirm your choice. Double-check that you have selected the correct table before you confirm the deletion as this action cannot be undone.

phpMyAdmin uses the term Drop to refer to the deletion of an entire table.
phpMyAdmin uses the term Drop to refer to the deletion of an entire table.

If deleting an entire database table is not an option for you, then you can consider removing individual entries from different tables that you no longer need. This can be achieved by running various SQL commands. Below, we will showcase a very basic SQL command that can delete a single database entry.

A sample table with two entries (rows). We will be removing the second row.
A sample table with two entries (rows). We will be removing the second row.

In this example, we will use the above table with two rows. The goal is to remove the second row while preserving the first.

You will notice that all tables usually have an id column that contains a unique number that identifies the given entry. In our example, the id column is actually called id, but your tables may use a different word as the column’s title. Once you locate the column that stores the unique identifiers for each entry, make a note of the value associated with the entry (row) that you wish to delete. With this information at hand, switch to the SQL tab and run the following SQL command:

DELETE FROM my_table where id_column = 'my_id';

In the above code you will need to make three replacements:

          • my_table should be replaced with the name of the table that you are deleting from.
          • id_column should be replaced with the name of the column that stores your unique identifiers.
          • my_id should be replaced with the actual identifier for the row that you wish to delete.

Our example uses the products table. This table has an id column and the unique identifier for the entry that we wish to delete is 2. So our SQL command should look like this:

A basic SQL command for deleting an entry with a specific identifier. With enough SQL knowledge you can create complex queries that delete data based on multiple criteria.
A basic SQL command for deleting an entry with a specific identifier. With enough SQL knowledge, you can create complex queries that delete data based on multiple criteria.

When we press the Go button, the SQL command gets executed and the deletion will be completed. Now our table no longer contains the second entry:

Be extra careful when using the DELETE command! Above all else, make sure that you have successfully located the column that contains the unique identifiers for the table.
Be extra careful when using the DELETE command! Above all else, make sure that you have successfully located the column that contains the unique identifiers for the table.

If you are using a modern content management system like WordPress, Drupal, Joomla, or similar, you should consider using the CMS’s backend administration tools for data management and removal. Manually deleting entries from the database should be your last resort.

 

Conclusion

As a website owner, it is always a good idea to keep an eye on your database usage. This is especially true if you are using a shared hosting plan and you have a cap on your database size. If you happen to reach your storage limit, your website can start displaying all manner of warnings and error messages, such as the perplexing “INSERT command denied to user” message.

The post How Can I Reduce the Size of a MySQL Database? appeared first on AwardSpace.com.

]]>
How to Fix phpMyAdmin Error 1044 “Access Denied for User” While Importing a Database Backup? https://www.awardspace.com/kb/fix-phpmyadmin-error-1044-when-importing-backup/ Tue, 10 Mar 2020 10:26:31 +0000 https://www.awardspace.com/?p=41952 The management of MySQL databases has come a long way thanks to tools like phpMyAdmin. Using phpMyAdmin you are able to not only manage your existing database but also import data from a database backup file with just a few clicks. Sometimes, however, you may run into an issue where a backup fails to import […]

The post How to Fix phpMyAdmin Error 1044 “Access Denied for User” While Importing a Database Backup? appeared first on AwardSpace.com.

]]>
The management of MySQL databases has come a long way thanks to tools like phpMyAdmin. Using phpMyAdmin you are able to not only manage your existing database but also import data from a database backup file with just a few clicks. Sometimes, however, you may run into an issue where a backup fails to import successfully and phpMyAdmin presents you with error 1044 “Access denied for user”. In this article, we will go over why this issue occurs and how to resolve it.

 

What Causes the phpMyAdmin Error 1044 “Access Denied for User”?

At its core, phpMyAdmin error 1044 signals that there may be something wrong with the permissions assigned to your database user. As the “Access denied for user” description suggests, your database user lacks the necessary privileges to execute one or more of the commands contained within your database backup.

The 1044 access denied error is generally limited to shared hosting accounts since they often do not have full root access to the database server. As such, you may run into this issue if you are using our free website hosting, premium shared hosting, or our Semi-Dedicated web server plans. The only hosting package where you would not be faced with such an issue is our VPS Cloud Hosting plan.

 

Which Commands Are Restricted in Shared Hosting?

In most shared hosting environments you will not be able to issue commands that directly manipulate entire databases. For example, you will not be able to create or delete a database using SQL commands. The two screenshots below illustrate what happens when you try to create and drop (delete) a database while working in a shared hosting environment:

Dropping (deleting) a database is a feature that will not be available on most shared hosting accounts and would yield a 1044 access denied error.
Dropping (deleting) a database is a feature that will not be available on most shared hosting accounts and would yield a 1044 access denied error.

Depending on the type of SQL commands that are contained in your backup file and the server configuration, the importing process may partially succeed. In other words, you can see an “Import has been successfully finished” message while also being presented with an “Access denied for user” error. If this happens to you, it is best to further troubleshoot the issue as you would almost certainly be missing some amount of data. You can view an example of such an error below:

Do not be deceived by the success message phpMyAdmin may report. If you see the access denied error, then some data was probably not imported successfully.
Do not be deceived by the success message phpMyAdmin may report. If you see the access denied error, then some data was probably not imported successfully.

In addition to database creation and deletion, in most cases, there are other types of commands that may be restricted if you are using a shared hosting plan. For instance, you may not be able to create new database users and grant them privileges. To learn more about these restrictions, you can read our article on what do to when a database user has insufficient privileges.

 

How Can the “Access Denied for User” Error be Fixed?

The first step in fixing the phpMyAdmin error 1044 ”Access denied for user” is identifying the problematic SQL commands. Once identified, these commands need to either be removed or they need to be run in a manner that would not cause such issues.

The two most common SQL commands that can lead to a 1044 access denied error have to do with the creation and deletion of an entire database. Such commands are often included when you make a backup of your MySQL database.

Your MySQL backup file can be packaged in different ways. In some cases, it can be provided to you as an archive using the .ZIP, .RAR, TAR, .7z or a similar extension. If you do have an archive on your hands, you would need to extract it and obtain its contents. The contents themselves should contain one or more files that have the .TXT or .SQL extension or perhaps no extension at all. You should be able to open these files using a plain text editor. If you are using Windows, we recommend opening the files using Notepad or Notepad++, Mac users can use TextEdit, and Linux users can use nano or vim.

In this article, we will use the sample code below:

/******************************************
Create the musicshop database
*****************************************/

DROP DATABASE IF EXISTS musicshop;
CREATE DATABASE musicshop;
USE musicshop;

-- create the tables
CREATE TABLE categories (
categoryID INT(11) NOT NULL AUTO_INCREMENT,
categoryName VARCHAR(255) NOT NULL,
PRIMARY KEY (categoryID)
);

CREATE TABLE products (
productID INT(11) NOT NULL AUTO_INCREMENT,
categoryID INT(11) NOT NULL,
productCode VARCHAR(10) NOT NULL UNIQUE,
productName VARCHAR(255) NOT NULL,
listPrice DECIMAL(10,2) NOT NULL,
PRIMARY KEY (productID)
);

CREATE TABLE orders (
orderID INT(11) NOT NULL AUTO_INCREMENT,
customerID INT NOT NULL,
orderDate DATETIME NOT NULL,
PRIMARY KEY (orderID)
);

-- insert data into the database
INSERT INTO categories VALUES
(1, 'Guitars'),(2, 'Basses'),(3, 'Drums');

If we try to run this code in phpMyAdmin, we would get the 1044 error. This is because we are attempting to both create and delete a database via SQL commands on a shared server. The specific code that is causing these issues is the following:

DROP DATABASE IF EXISTS musicshop;
CREATE DATABASE musicshop;
USE musicshop;

Since we cannot run these commands via phpMyAdmin, we would need to perform them by hand using the Database Manager section of the Hosting Control Panel:

  • the first command DROP DATABASE IF EXISTS musicshop; instructs us to delete a database called musicshop if it already exists.
  • the second command CREATE DATABASE musicshop; instructs us to create a new database called musicshop.
  • lastly, the third command USE musicshop; simply asks us to make sure that musicshop is the active database. We can do that by opening it in phpMyAdmin.

Once the problematic commands are performed manually, we need to remove them from the backup file. Using the text editor of your choice, remove the commands outlined earlier in our tutorial and then save your changes. In our example, the end result would be a file with the following contents:

/******************************************
Create the musicshop database
*****************************************/

-- create the tables
CREATE TABLE categories (
categoryID INT(11) NOT NULL AUTO_INCREMENT,
categoryName VARCHAR(255) NOT NULL,
PRIMARY KEY (categoryID)
);

CREATE TABLE products (
productID INT(11) NOT NULL AUTO_INCREMENT,
categoryID INT(11) NOT NULL,
productCode VARCHAR(10) NOT NULL UNIQUE,
productName VARCHAR(255) NOT NULL,
listPrice DECIMAL(10,2) NOT NULL,
PRIMARY KEY (productID)
);

CREATE TABLE orders (
orderID INT(11) NOT NULL AUTO_INCREMENT,
customerID INT NOT NULL,
orderDate DATETIME NOT NULL,
PRIMARY KEY (orderID)
);

-- insert data into the database
INSERT INTO categories VALUES
(1, 'Guitars'),(2, 'Basses'),(3, 'Drums');

This file should now be fully compatible with shared hosting environments and you should be able to import it without any issues using phpMyAdmin:

Success! The modified backup file was successfully imported via phpMyAdmin with no error 1044 in sight.
Success! The modified backup file was successfully imported via phpMyAdmin with no error 1044 in sight.

 

The 1044 Access Denied Error Persists. What Else Can Be Done?

In rare cases, you may still be faced with the ”Access denied for user” error once you perform the above actions. If this happens to you, we recommend thoroughly checking your entire SQL code for any other CREATE DATABASE or DROP DATABASE statements.

Depending on how the database backup was made, it may be instructing phpMyAdmin to create not one, but multiple databases in one go. In these situations, you would need to use the CREATE DATABASE commands as dividers and split your backup file into several files where each file is responsible for restoring a single database.

Then, you would need to follow our guide as outlined above for each of these backup files in order to manually carry out the database creation and deletion commands.

 

Conclusion

While the phpMyAdmin error 1044 “Access denied for user” may sound serious and difficult to resolve, in most cases, it actually takes a just handful of small edits to fix the problem. All you need is a few minutes of work, patience, and a plain text editor. And if all else fails, you can always contact the 24/7 Technical Support Team via a Trouble Ticket for additional assistance.

The post How to Fix phpMyAdmin Error 1044 “Access Denied for User” While Importing a Database Backup? appeared first on AwardSpace.com.

]]>
What Does the “You have no privileges” Error Mean in phpMyAdmin? https://www.awardspace.com/kb/phpmyadmin-no-privileges/ Tue, 26 Sep 2017 08:35:59 +0000 https://www.awardspace.com/?page_id=13783 The dreaded “You have no privileges” error in phpMyAdmin. PhpMyAdmin is a highly versatile tool for managing your databases. Not only does it come with an easy-to-use interface that is great for new users, but it also supports the execution of raw SQL commands, giving more advanced webmasters the flexibility they need. But from time […]

The post What Does the “You have no privileges” Error Mean in phpMyAdmin? appeared first on AwardSpace.com.

]]>
The dreaded “You have no privileges” error in phpMyAdmin.
The dreaded “You have no privileges” error in phpMyAdmin.

PhpMyAdmin is a highly versatile tool for managing your databases. Not only does it come with an easy-to-use interface that is great for new users, but it also supports the execution of raw SQL commands, giving more advanced webmasters the flexibility they need. But from time to time, you may come across unexpected errors that can stop you dead in your tracks. One such error is “You have no privileges.” In this article, we will go over what this error means, when it occurs, and how to work around it.

 

What Does the “You have no privileges” Error Mean in phpMyAdmin?

The “You have no privileges” error in phpMyAdmin occurs whenever you attempt an operation that expects you to have full administrative control over the database server. Since you are using a shared hosting environment, your MySQL account is limited, and not all SQL commands are made available to you.

In fact, as a shared hosting user, you are allowed to have a single login for each of your databases. The login exactly matches the name that you have given to your database. For example, if you have a database called 10000_mydatabase, then the username you should use to access this database is also 10000_mydatabase.

These restrictions apply to our free website hosting, the premium shared hosting plans that we offer, and even our Semi-Dedicated web servers. Full unfettered access is only possible when using a Virtual Private Server package.

 

Which Commands Are Forbidden in a Shared Hosting Environment?

phpMyAdmin is unable to create a new MySQL database because the user has no privileges.
phpMyAdmin is unable to create a new MySQL database because the user has no privileges.

There are two broad categories of commands that are forbidden: those that manage users and those that manage entire databases. More specifically, you will not be able to create new users or grant new privileges to existing users using commands such as CREATE USER, GRANT or REVOKE. Similarly, you cannot make edits to databases as a whole. This includes the use of CREATE DATABASE to create a new database and DROP DATABASE to delete an existing database. All other commands, such as working with tables, data fields, views, and stored procedures, are still allowed.

 

How Can I Work Around These Limitations?

Database creation and deletion can be achieved using the dedicated Database Manager section of the Control Panel.
Database creation and deletion can be achieved using the dedicated Database Manager section of the Control Panel.

If you need to create a new database or delete an existing one, you should use the Database Manager section of our Control Panel. Renaming a database can be achieved by backing up the database, deleting it, creating a new database with the desired name, and finally importing your initial database backup. To learn more, you can check our in-depth overview of the Database Manager.

Database user management is, unfortunately, more restricted due to the nature of shared hosting. As we have previously outlined, it is not possible to add/remove users from your database. It is also not possible to grant yourself additional permissions and privileges. The only type of customization that is possible is the renaming of the default username. This is achieved by creating a brand new database with a name that matches the desired username.

 

Going Further With a Virtual Private Server

If you prefer to have full control over your hosting environment and not have to deal with shared hosting limitations, you should consider getting a VPS. A Virtual Private Server is a standalone Linux instance where you are given full root access. You get to choose every single program and package that is installed on the machine and even pick the operating system itself!

The only downside to using a Virtual Private Server is the fact that good working knowledge of Linux is required. The vast majority of VPS instances run Linux distributions that lack a graphical user interface in order to maximize performance. In other words, you need to be comfortable completely managing and maintaining your VPS through the command line.

 

Conclusion

While having a shared hosting account comes with many great benefits, it is by definition limited and this lack of advanced functionality may cause roadblocks you wouldn’t ordinarily experience. Using a Virtual Private Server for your hosting needs would resolve many of these issues and points of friction. Not having fine-grained control over your hosting space, including database management, and not being able to import an SQL backup in phpMyAdmin because it tries to create a database during its restoration process will all be a thing of the past.

The post What Does the “You have no privileges” Error Mean in phpMyAdmin? appeared first on AwardSpace.com.

]]>
How Do I Create a MySQL Table That Uses the InnoDB Storage Engine? https://www.awardspace.com/kb/create-innodb-database/ Wed, 20 Sep 2017 13:25:30 +0000 https://www.awardspace.com/?page_id=13370 MySQL databases, like any other software product, are constantly being developed and new features are being added all the time. Popular CMSs like WordPress and Joomla are quick to adopt these new database features in order to improve security, reliability, and performance. In this article, we will take a look at one of the most […]

The post How Do I Create a MySQL Table That Uses the InnoDB Storage Engine? appeared first on AwardSpace.com.

]]>
MySQL databases, like any other software product, are constantly being developed and new features are being added all the time. Popular CMSs like WordPress and Joomla are quick to adopt these new database features in order to improve security, reliability, and performance. In this article, we will take a look at one of the most important aspects of a MySQL database – its storage engine. We will discuss what a storage engine is and how to change the storage engine for your MySQL database tables.

 

What Is a Database Storage Engine?

At its most basic level, a database storage engine is a program that directly manipulates the information stored within the database. The storage engine accepts commands through its programming interface (API). These commands instruct the engine to create, read, update or delete one or more database entries.

 

What Is the Default Storage Engine?

Currently, if you start creating new tables in your database without specifying a storage engine, the MyISAM storage engine will be used by default. The good news is that if you later realize that you need a different engine for your table, you will be able to change it without any data loss.

 

How Can I Discover Which Storage Engine Is Used on a Particular Table?

If you are not sure which storage engine is being used in your table, you can easily find out through phpMyAdmin or by sending an SQL query. We will cover both approaches.

To discover which storage engine you are using through phpMyAdmin’s interface, follow these steps:

  1. Navigate to the phpMyAdmin utility in your web browser.
  2. If necessary, log in using your database credentials (not your hosting account credentials).
  3. Click on the table name which you would like to inspect from the list of the left.
  4. Switch to the Operations tab.
  5. You will find your Storage Engine listed in the Table options section.
phpMyAdmin lists the storage engine that is in use right inside of the Operations tab.
phpMyAdmin lists the storage engine that is in use right inside of the Operations tab.

If you are in a hurry or just prefer to send SQL commands manually, you can jump to the SQL tab of phpMyAdmin (or create a script that connects to your database) and run the following query (make sure that you replace table-name with the actual name of the table you are querying):

SHOW TABLE STATUS WHERE `Name` = 'table-name';

The results will be presented in a table format. The storage engine will be listed in the Engine column, as shown below:

The results of the SHOW TABLE STATUS query. The Storage Engine type is highlighted.
The results of the SHOW TABLE STATUS query. The Storage Engine type is highlighted.

 

How Do I Create a MySQL Table That Uses the InnoDB Storage Engine?

If you know that your site will be requiring the InnoDB storage engine, you can easily create your new tables using InnoDB from the onset. The InnoDB engine is available on all of our paid hosting plans and even on our free hosting service. In fact, there are two different ways you can set your storage engine, depending on how you create your table – via the phpMyAdmin interface or using an SQL command.

You can create a table with InnoDB as its storage engine via phpMyAdmin’s interface by following the steps below:

  1. Navigate to the phpMyAdmin utility in your web browser.
  2. If necessary, log in using your database credentials (not your hosting account credentials).
  3. Click on the database name from the list of the left in order to indicate where you would like to include the new table.
  4. In the Create table section, pick a name for your new table and choose the number of columns.
  5. Press the Go button in order to start creating your new table.
Creating a new table through the phpMyAdmin interface.
Creating a new table through the phpMyAdmin interface.
  1. You will be taken to the table creation interface. Locate the Storage Engine section and make sure that InnoDB is selected from the dropdown.
  2. Finish creating your table by customizing each column. When done, press the Save button.
Creating a table with InnoDB as the storage engine is as simple as choosing InnoDB from the Storage Engine dropdown menu.
Creating a table with InnoDB as the storage engine is as simple as choosing InnoDB from the Storage Engine dropdown menu.

If you prefer to use your own SQL statements when creating a new table, simply make sure to append ENGINE=InnoDB to your statement as is shown in the example below:

CREATE TABLE new-table (a INT NOT NULL, b CHAR(10)) ENGINE=InnoDB;


How Do I Convert an Existing MySQL Table From the MyISAM Storage Engine to InnoDB?

You may be surprised to learn that it is indeed possible to change the storage engine for an existing MySQL table. And best of all – your data will remain safe. Converting your table from MyISAM to InnoDB is a straightforward process that can be achieved via both phpMyAdmin and an SQL query.

To convert your storage engine via phpMyAdmin, follow the steps below:

  1. Navigate to the phpMyAdmin utility in your web browser.
  2. If necessary, log in using your database credentials (not your hosting account credentials).
  3. Click on the table name which you would like to modify from the list on the left.
  4. Switch to the Operations tab.
  5. Locate the Table options section and use the dropdown menu to Storage Engine to change your storage engine from MyISAM to InnoDB.
  6. Once you have made your selection, press the Go button at the bottom of the Table options section in order to save your changes.
phpMyAdmin allows you to update the storage engine that is in use right inside of the Operations tab.
phpMyAdmin allows you to update the storage engine that is in use right inside of the Operations tab.

As an alternative, you can also execute an ALTER TABLE SQL statement in order to start using a different storage engine (make sure to replace table-name with the actual name of the table you are modifying):

ALTER TABLE `table-name` ENGINE = InnoDB;

The only caveat that should be mentioned is that some storage engines have features that are not found in other storage engines. So if you convert from a storage engine with more features to one with fewer, you may lose some of these extra customizations. Continue reading in order to find the most notable differences between the MyISAM and InnoDB storage engines.

 

What Are the Main Differences Between the InnoDB and MyISAM Storage Engines?

While in most cases your website software will dictate the type of storage engine you should use, some packages support both types of storage engine and it will be ultimately up to you which storage engine you will use. Below is a brief comparison between the two most popular storage engines InnoDB and MyISAM.

Overall, InnoDB is the more advanced storage engine. It uses a relational base design that enables features like transactions, foreign keys, and row locking. Consequently, you will experience better performance if your project executes a lot of inserts, updates, and deletes. InnoDB is also geared towards large databases.

Conversely, MyISAM excels in terms of performance if your project mainly reads from the database without modifying any data. MyISAM is also the preferred storage engine for smaller projects.

 

Conclusion

The ability to quickly switch between the different storage engines gives you the flexibility to adapt your database to your project’s needs as it grows over time. And since your data is automatically preserved with each storage engine change, you can experiment with different storage engines with no risk and minimal effort.

The post How Do I Create a MySQL Table That Uses the InnoDB Storage Engine? appeared first on AwardSpace.com.

]]>
How Do I Fix the “Can’t Connect to Local MySQL Server Through Socket” Error? https://www.awardspace.com/kb/cannot-connect-local-mysql-server-socket/ Thu, 14 Sep 2017 12:22:22 +0000 https://www.awardspace.com/?page_id=13133 At the heart of most content management systems lies a database, such as MySQL, where the majority of content is stored. So for your pages to fully load, your website needs to be able to fetch the necessary information from the database at a moment’s notice. If for some reason a connection to the database […]

The post How Do I Fix the “Can’t Connect to Local MySQL Server Through Socket” Error? appeared first on AwardSpace.com.

]]>
At the heart of most content management systems lies a database, such as MySQL, where the majority of content is stored. So for your pages to fully load, your website needs to be able to fetch the necessary information from the database at a moment’s notice. If for some reason a connection to the database cannot be established, you may see an error such as “Warning: mysql_connect(): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock”. In this article, we will explore what is causing this problem and how to fix it.

What Does the PHP Warning “mysql_connect() can’t connect to MySQL server” Mean?

If your website shows a message that it cannot connect to the local MySQL server through a socket, then the connection settings that you have entered are probably incorrect or incomplete. Double-checking these settings are very likely to fix this issue.

 

An example of the “mysql_connect() can’t connect to MySQL server” warning can be seen below:

If your website has trouble connecting to its database, it may display an error message similar to this one.
If your website has trouble connecting to its database, it may display an error message similar to this one.

 

How Can I Fix the “Can’t Connect To Local MySQL Server Through Socket” Error?

First and foremost, you need to head to the Database Manager section of our Control Panel and click on the database that you are trying to connect to. From there, click on the Information tab.

The information tab will provide you with all credentials necessary to successfully connect to your MySQL database.
The information tab will provide you with all credentials necessary to successfully connect to your MySQL database.

In the Information tab, you will find your Database Host, Database Port, Database Name, Database User, Database Version, and Database Storage Engine. Compare this information to the database settings in your website configuration file and make changes where necessary. If you are not sure what password is assigned to your database, you can reset it from the Password tab in the Database Manager. Additional help with connecting your website to your database, including sample connection code, can be found in our article on where to find the database connection settings.

The Database Manager will be available to you if you are using our free hosting, premium shared hosting or one of the Semi-Dedicated web server plans. You can read our in-depth walkthrough of the Database Manager to familiarize yourself with all of the features this section of our Control Panel has to offer.

If you own a Virtual Private Server, then you can manage your databases through the command line via a remote connection to the server. Our VPS instances can also come equipped with special variants of popular Linux distributions that allow access to our Easy VPS Control Panel where you can manage your databases.

While setting up most website software packages, such as WordPress, Joomla, and others, you will be asked to provide your database information. Some fields may be prefilled as a point of convenience, however, the prefilled information will not always be correct. One such instance is the Database Server/Host field. By default, you will see the text localhost prefilled, but if you are using our shared hosting platform, then this value is incorrect. Be sure to update the field to have the same value as the Database Host entry in the Database Manager section of the Control Panel.

 

What is localhost?

The term localhost is used in computer networking to denote the current computer. The localhost name is a shorthand for the IP address 127.0.0.1 which is referred to as the loopback address and it allows the computer to take advantage of any network services that it may be broadcasting.

So when you see localhost automatically prefilled while installing a website software package, it means that the installer assumes that the database server is located on the same physical machine as the web server that is powering the installer itself.

While placing the web server and database server applications on the same computer may be true for some hosting providers, we use separate machines to act as the web and database servers. The benefit of this approach is that we can balance the servers’ load across multiple machines, thus sustaining better performance and responsiveness at times of peak utilization.

The lone exception to this rule is our Virtual Private Server plans. If you own a VPS, you can run the web and database server applications in the same instance and can thus take advantage of the localhost hostname.

 

Conclusion

Errors related to database connection issues can often be cryptic and not provide a lot of actionable information. As such, it is always a good idea to double-check your database connection settings before proceeding with more in-depth troubleshooting. If you are using one of the more popular content management systems out there, such as WordPress, Joomla, PrestaShop, Drupal or similar, you should consider going over our article on how to resolve database connections issues with most CMS’s.

The post How Do I Fix the “Can’t Connect to Local MySQL Server Through Socket” Error? appeared first on AwardSpace.com.

]]>
How Do I Fix MySQL Error #1142 “INSERT Command Denied to User”? https://www.awardspace.com/kb/insert-command-denied/ Thu, 14 Sep 2017 12:20:05 +0000 https://www.awardspace.com/?page_id=13131 Having your own custom website is one of the most rewarding experiences you can have online, but from time to time, it can also throw seemingly random errors at you for no apparent reason. One of the more perplexing errors is MySQL error #1142 “INSERT command denied to user”. Unlike other errors, this particular issue […]

The post How Do I Fix MySQL Error #1142 “INSERT Command Denied to User”? appeared first on AwardSpace.com.

]]>
Having your own custom website is one of the most rewarding experiences you can have online, but from time to time, it can also throw seemingly random errors at you for no apparent reason. One of the more perplexing errors is MySQL error #1142 “INSERT command denied to user”. Unlike other errors, this particular issue can pop up in almost all content management systems, in phpMyAdmin, and even in code that you have written yourself. In this article, we will learn what causes the #1142 error and we will go over the possible solutions to this issue.

 

What Is Causing MySQL Error #1142 “INSERT Command Denied to User”?

As the error message ”INSERT command denied to user” suggests, the root problem is that the INSERT command fails. The INSERT command is used to add new information to your MySQL database. So, you can potentially run into this problem whenever you update your website with new information or when you try to manually insert new data into your database.

Since this is a database-related issue, it can pop up on any website that uses a database to store information. The issue can affect everything from world-renowned content management systems like WordPress, Joomla, and Drupal, to small PHP websites that you may have coded yourself.

If you have a Joomla website and you run into the "INSERT command denied to user" problem, you may see a message similar to this one.
If you have a Joomla website and you run into the “INSERT command denied to user” problem, you may see a message similar to this one.

The #1142 error is most prevalent in shared hosting environments. Plans such as our free website hosting and our premium shared hosting packages fall into this category. The reason is that shared hosting plans often impose a limit, known as a quota, on the amount of information that can be stored in a single database.

 

What Is a Database Quota?

As more information is stored in a database, its size steadily grows. That is why hosting companies often impose a database quota which is essentially a storage limit for your database. When you reach this limit, you are no longer permitted to add new information to the database. In technical terms, when you reach your database storage limit, your database user loses its INSERT privileges.

 

How Can I Check My Database Quota and Current Space Usage?

You can easily check the current size of your MySQL database as well as the database quota imposed by your hosting plan using the Database Manager section of the Control Panel, as is shown below:

The Database Manager has a dedicated Quota column where you can easily compare your current space usage to the maximum that is allowed by your hosting plan.
The Database Manager has a dedicated Quota column where you can easily compare your current space usage to the maximum that is allowed by your hosting plan.

The only thing that we need to point out is that your current utilization statistics are not updated in real-time. As such, it may take an hour or so for any changes to the size of your database to be reflected in our Database Manager.

 

How Do I Fix MySQL Error #1142 “INSERT Command Denied to User”?

There are three approaches you can take to resolve the ”INSERT command denied to user” problem:

  • you can optimize your database in order to reduce its size without sacrificing any of your data.
  • you can delete information that you no longer need.
  • you can upgrade to a better hosting plan that grants you additional database storage.

Below we will discuss the three options in greater detail.

 

Option 1: Optimize the Database

Optimizing the database is arguably the best approach to take as it allows you to instantly reduce your database’s size without sacrificing any data. The only downside to this option is that for large websites this can prove to be only a temporary solution.

To optimize your database, follow the steps below:

  1. Go to the Database Manager section of our Control Panel.
  2. Click on the name of the database that is over quota.
  3. Open the Management tab.
  4. Choose the 1-click Optimization option, as is shown in the screenshot below:
Optimizing your database is truly a one-click solution thanks to our Database Manager.
Optimizing your database is truly a one-click solution thanks to our Database Manager.
  1. At this point, your database is optimized. However, it may take some time for this optimization to be reflected. To speed up the process, scroll further down the list of management options and choose the 1-click Permissions Fix button. By doing so, you will be granted full access to your database immediately and you can continue working on your website.
Using the 1-click Permissions Fix button you can speed up the optimization process allowing you to continue working on your website immediately.
Using the 1-click Permissions Fix button you can speed up the optimization process allowing you to continue working on your website immediately.

For more information on how database optimization works and the different ways of optimizing your database that you have available, you can refer to our full guide on how to optimize a MySQL database.

 

Option 2: Delete Unnecessary Data

Your other alternative when it comes to reducing your database size is to straight-up delete any data that is no longer necessary. This can be achieved using phpMyAdmin to DROP (delete) any tables that you no longer need. An example of this can be seen below:

Removing unnecessary information from the database is a sure-fire way of reducing its size.
Removing unnecessary information from the database is a sure-fire way of reducing its size.

Some website software products offer the ability for you to log every site visit for further analysis at a later time. Such information is often stored in your database. While this may be a useful feature to some, it can very quickly take up the majority of your database, especially if you have regular site visitors who spend plenty of time on your site. Disabling this logging functionality and removing the existing logs from the database can free up hundreds of megabytes.

Another aspect of running a website that can consume a lot of database storage is user-generated content such as reader comments on a blog post. At the very least you should ensure that no SPAM comments are published as are not helpful in the slightest and take up valuable storage space. An even better approach would be to consider using a service like DISQUS as it not only helps protect you against SPAM comments, it even stores all comments on its own servers so they are not taking up any space at all in your database.

 

Option 3: Upgrade to a Better Hosting Plan

The last option that you have at your disposal is to upgrade to a better hosting plan. The next tier of hosting will always offer you more storage for your databases and our premier plans like the Max Pack Plus and all of our Semi-Dedicated web servers will provide you with unlimited storage, thus dealing with the #1142 error once and for all.

 

If all else fails, you can always upgrade to a hosting plan that offers unlimited database storage.
If all else fails, you can always upgrade to a hosting plan that offers unlimited database storage.

If you are using one of our Virtual Private Server packages and you run into the “INSERT command denied to user” error, it is possible that your VPS has run out of space and there is simply no room for additional information to be stored. Once you confirm that the lack of storage is indeed the issue, you can purchase additional disk space for your VPS through our Control Panel.

 

Conclusion

When you are using a shared hosting server, you can solve the MySQL error #1142 “INSERT command denied to user” by making sure that your current database utilization does not exceed your database quota. This can be done by optimizing the database, deleting data, or just increasing your database quota. Sadly, some content management systems use different wording for the exact same error, so if your hosting plan limits the maximum size of your MySQL database, it is always a good idea to regularly check that you are not reaching your storage limit.

The post How Do I Fix MySQL Error #1142 “INSERT Command Denied to User”? appeared first on AwardSpace.com.

]]>