The following web hosting support article is an in-depth look at the tech support questions people often have about all things databases, related to MS-SQL, MySQL and PHPmyAdmin.
MS-SQL database FAQ’s
Can I connect to a MS-SQL database from my Linux hosting account? |
|
Can I manage my MS-SQL database with Microsoft SQL Server Management Studio? |
In your eXtend Control Panel, you should be able to find the server’s IP address and port as well as your username and password in the MS-SQL Databases area. To connect remotely to your database:
|
How do I back up and restore my MS-SQL database? |
To back up your MS-SQL database:
To restore your MS-SQL database:
The MS-SQL Web Data Administrator Tool can only produce and restore .sql files. Please raise a Support Ticket with the Customer Services team if you have a .bak file from another MS-SQL server you need to restore from. |
What are valid connection strings on the Windows platform? |
MSAccess: Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db.mdb;User Id=admin;Password=; Driver={Microsoft Access Driver (*.mdb)};Dbq=db.mdb;Uid=Admin;Pwd=; MS-SQL (.NET Framework for SQL Server): To connect MS-SQL, you have a few options: Connecting to an MS-SQL Server database with OLE DB: Set objConn = Server.CreateObject(“ADODB.Connection”) As would be seen in web.config: <connectionStrings> Or connect to an MS-SQL Server database with SQL Driver: Set objConn = Server.CreateObject(“ADODB.Connection”) |
MySQL database FAQ’s
Can I have MySQL 4 instead of the current version? |
|
Can I rename my database getting rid of the ’web-’ part of the name? |
|
Can I use CocoaMySQL? |
|
How can I connect to a MySQL database through .NET? |
Server=myServerAddress;Database=myDatabase;Uid=myUsername;Pwd=myPassword; The port 3306 is the default MySQL port, but you can use a different TCP port if you require it. If the UNIX socket is used, this value will be ignored. Server=myServerAddress;Port=1234;Database=myDatabase;Uid=myUsername;Pwd=myPassword; Through this, you can connect to a server in a replicated server configuration without needing to worry about which server to use. Server=serverAddress1, serverAddress2, serverAddress3;Database=myDatabase;Uid=myUsername;Pwd=myPassword; If you have an SSL certificate installed onto your server, you can use this to activate SSL encryption for all data sent between the client and the server. Server=myServerAddress;Database=myDatabase;Uid=myUsername;Pwd=myPassword;Encrypt=true; Preventing batch mode or batch files from running can protect your database from major changes. Server=myServerAddress;Database=myDatabase;Uid=myUsername;Pwd=myPassword;AllowBatch=False; You can allow users to enter in their own data by allowing user variables. Server=myServerAddress;Database=myDatabase;Uid=myUsername;Pwd=myPassword;AllowUserVariables=True; This will return a MySQL DateTime object for invalid values and a System.DataTime object for valid values. Server=myServerAddress;Database=myDatabase;Uid=myUsername;Pwd=myPassword;AllowZeroDate=True; This returns System.DataTime.MinValue valued System.DataTime object for invalid values and a System.DataTime object for valid values. Server=myServerAddress;Database=myDatabase;Uid=myUserName;Pwd=myPassowrd;ConvertZeroDateTime;True; The use of auto-enlist transactions can cause trouble in Medium Trust environments. This removes it as the default behaviour. Server=myServerAddress;Database=myDatabase;Uid=myUsername;Pwd=myPassword;AutoEnlist=False; Parameters for stored routines and procedures are checked against the server and can slow down the system. This removes it as the default behaviour. Server=myServerAddress;Database=myDatabase;Uid=myUsername;Pwd=myPassword;CheckParameters=False; If you have errors related to permissions and value casting, these errors can be fixed by this string. Server=myServerAddress;Database=myDatabase;Uid=myUsername;Pwd=myPassword;UserProcedureBodies=False; This uses the changed rows instead of found rows, providing different data as needed. Server=myServerAddress;Database=myDatabase;Uid=myUsername;Pwd=myPassword;UseAffectedRows=True; This can cut down on the amount of time it takes to implement a script. Server=myServerAddress;Database=myDatabase;Uid=myUsername;Pwd=myPassword;UseCompression=True; Log operations that are inefficient, for tighter development later on. Server=myServerAddress;Database=myDatabase;Uid=myUsername;Pwd=myPassword;UserUsageAdvisor=True; Turn on the performance counters for your project, and review regularly for optimised programming. Server=myServerAddress;Database=myDatabase;Uid=myUsername;Pwd=myPassword;UserPerformanceMonitor=True; |
How can I manage my MySQL database? |
|
How can I upload my MySQL database? |
To use ‘Import’:
Please note: ‘Import’ can only be used on databases that are smaller than 16MB. To paste your SQL script in:
If your SQL script contains a large amount of data, you may be able to paste it in sections to get all the content in. You can restore existing backups through the eXtend Control Panel MySQL Database page. To restore a backup:
MySQL offers the MySQL Workbench, a piece of free software that allows you to manage, backup, and restore MySQL databases. The software can restore large databases, and also comes packaged with the MySQL Query Browser. To download and find out more about MySQL Workbench, please visit the MySQL site: http://dev.mysql.com/downloads/workbench/ If you have SSH access to your account, you can upload your MySQL backup to your home directory, and then execute the MySQL client to load a MySQL dump file. To get the MySQL dump file:
Mysqldump –opt -Q dbname Where the dbname is your database’s name
To load your MySQL dump using MySQL:
mysql -h mysqlhost -u mysqlusername -p databasename < dumpfile.sql or cat dumpfile | mysql -h mysqlhost -u mysqlusername -p databasename Where mysqlhost is the name of the server, mysqlusername is your MySQL user name, datbasename is your database’s name, and dumpfile.sql is the file created by mysqldump. |
How do I back up my MySQL database? |
You can use phpMyAdmin to download a backup of your database by using ‘Export’.
If you have SSH access to your account, you can download a backup of your MySQL database to the current directory you are in. To create the backup:
mysqldump -h servername -u username -p –add-drop-table –create-options –skip-add-locks -e –set-charset –disable-keys -Q databasename > databasedump.sql Where servername is your server’s name, username is your user name, and databasename is the database’s name. You can name the backup anything as long as .sql is at the end. To backup and compress the dump file:
mysqldump -h servername -u username -p –add-drop-table –create-options -e –set-charset –skip-add-locks –disable-keys -Q databasename | gzip > databasedump.sql.gz
MySQL offers the MySQL Workbench, a piece of free software that allows you to manage, backup, and restore MySQL databases. The software also comes packaged with the MySQL Query Browser. To download and find out more about MySQL Workbench, please visit the MySQL site: http://dev.mysql.com/downloads/workbench/ |
How do I connect to my MySQL database from my Perl script? |
use DBI; # Connect To Database $database = “your database name”; # Execute a Query $query = $db->prepare(“SELECT * FROM test”); # How many rows in result? $numrows = $query->rows; # Display Results while (@array = $query->fetchrow_array) { ($field1, $field2, $field3) = @array; print “field1 = $field1, field2 = $field2, field3 = $field3 \n”; } # Cleaning Up $query->finish; exit(0); |
How do I connect to my MySQL database using PHP? |
<?php $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die (‘Error connecting to mysql’); $dbname = ‘[DATABASE NAME]’; Replace [DATABASE USERNAME] with the name of your database user. Replace [DATABASE PASSWORD] with the password for your database user. Replace [DATABASE NAME] with the name of your database.
When you want to access the database in any PHP script:
include ‘[NAME].php’
mysql_query(‘QUERY’) |
How do I connect to MySQL databases through SSH? |
[username] – Your username [databasename] – The database’s name You will then be prompted to enter in the database’s password. Once you have logged into the database, you will be at the MySQL prompt. For more information on the commands you can use in the MySQL prompt, please refer to the MySQL Documentation: http://dev.mysql.com/doc/ |
How do I connect to MySQL with ASP? |
rsEvents.ActiveConnection = “Driver={MySQL ODBC 5.1 Driver}; DATABASE=[DATABASE NAME];USER=[USER NAME]; PASSWORD=[PASSWORD]; Server=[SERVER IP ADDRESS]” Or the following JScript: var rsEvents = Server.CreateObject(“ADODB.Recordset”); rsEvents.ActiveConnection = “Driver={MySQL ODBC 5.1 Driver}; DATABASE=[DATABASE NAME];USER=[USER NAME]; PASSWORD=[PASSWORD]; Server=[SERVER IP ADDRESS]”; Replace [DATABASE NAME] with the name of your database. Replace [USER NAME] with your user name. Replace [PASSWORD] with your password. Replace [SERVER IP ADDRESS] with your server’s IP address or name (which you can find in your eXtend control panel). |
How do I create a MySQL database? |
In the MySQL Databases section, you can also manage existing databases, create new database users, or delete databases if you no longer need them. |
How do I grant permissions to a MySQL standalone user? |
By default, a standalone user has no permissions for the database. You must grant each permission specifically for the user. If you have created the database and the standalone user, you can grant permissions for the standalone user by:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES ON `webXX-dbname`.* TO ‘n-webXX-user’@’%’ WITH GRANT OPTION;
You can also adjust the permissions of your standalone user by using PHPMyAdmin. To access your standalone user:
If there are any other privileges you need to grant on a database, but you do not have access to those permissions, please raise a Support Ticket with our Customer Services team with the details. |
How do I increase the MAX_JOIN_Size when my script gives an error about it being too low? |
|
How do I log into MySQL as the root user on my Plesk server? |
And now that you know the password, you can log into MySQL with root administration privileges on any version of Plesk with this command line: mysql -uadmin –p’cat /etc/psa/.psa.shadow’ This command gives you access to the MySQL database on the server. |
How do I set up a MySQL connection in Dreamweaver? |
|
How do I use PHP to connect to another database on another server? |
If you need to connect to a database that is on another server, you would replace localhost with the IP address of the server. You can find the IP address of the database’s server by checking your eXtend Control Panel.
|
Is there a graphical interface available for MySQL? |
When you have downloaded and installed MySQL Workbench onto your computer, you can connect it to your MySQL database and run queries, create or edit SQL statements, manage your databases, create, modify, or delete tables, and get help and information on objects, parameters, and functions within MySQL. To connect MySQL Workbench to your database:
|
What are the default privileges for MySQL databases? |
UPDATE – Updates the data in tables or columns in the database DELETE – Deletes rows from tables in the database CREATE – Creates new databases, tables, or columns DROP – Removes existing databases, tables, and views INDEX – Creates or removes indices of existing tables ALTER – Allows you to alter tables in the database LOCK TABLES – Allows you to lock tables within the database The following privileges can also be granted: CREATE TEMPORARY TABLES – Creates temporary data tables in the database CREATE VIEW – Creates new views of the data CREATE ROUTINE – Creates stored routines in the database Please raise a Support Ticket with our Customer Services team to acquire these additional privileges. |
What are valid connection strings on the Windows platform? |
MSAccess: Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db.mdb;User Id=admin;Password=; Driver={Microsoft Access Driver (*.mdb)};Dbq=db.mdb;Uid=Admin;Pwd=; MS-SQL (.NET Framework for SQL Server): To connect MS-SQL, you have a few options: Connecting to an MS-SQL Server database with OLE DB: Set objConn = Server.CreateObject(“ADODB.Connection”) As would be seen in web.config: <connectionStrings> Or connect to an MS-SQL Server database with SQL Driver: Set objConn = Server.CreateObject(“ADODB.Connection”) |
What do I do if I get this error on the Plesk login page: “ERROR: PleskFatalException: Unable to connect to database: mysql_connect(): Connection refused”? |
service mysqld restart
However, this often does not work. The MySQL service needs to create a file in order to run, but it cannot create the file because a duplicate file of the same name exists. To fix this problem:
mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
service mysqld restart
|
What is MySQL and what does it do? |
MySQL is an essential aspect of many content management systems and other web-based applications, such as WordPress, Joomla!, phpBB, and osCommerce. MySQL is also an open source database solution, meaning that it is possible for anyone to use and modify the software as needed. |
What is the maximum MySQL database size permitted? |
|
What software do you have on your servers? |
We also have a range of Perl, PHP, and Pear modules installed, which you can see in the eXtend Control Panel.
Please note: These are the current and correct versions of our software packages, as of October 2018. We have a regular schedule of maintenance and upgrading for our servers to ensure the most up to date software and the best possible performance and features for our customers. |
Where can I find documentation for some of the software available on my hosted package account or server? |
There are also Frequently Asked Questions at http://cpanel.net/help/ and a Support Forum at http://forums.cpanel.net/. MailEnable, the email service for Windows servers, is included with all Windows-based Dedicated Servers. Official documentation on MailEnable can be found at http://www.mailenable.com/references.asp. The MailEnable Knowledge Base can be found at http://www.mailenable.com/KB/search.asp. And there is also a Support Forum for MailEnable at http://forum.mailenable.com/. You can find the official documentation for MySQL at http://dev.mysql.com/doc/. There is also a MySQL developer’s area at http://dev.mysql.com/ and user forum at http://forums.mysql.com/. You can find the official documentation for the Ubuntu operating system at https://help.ubuntu.com/. There is also a community-maintained Wiki at https://help.ubuntu.com/community/CommunityHelpWiki. You can find the official documentation for Windows Web Server 2008 at http://technet.microsoft.com/en-us/library/dd349801(v=ws.10).aspx. You can also find the documentation for the latest versions of Windows Server at http://technet.microsoft.com/library/bb625087.aspx. There is also information and advice on how to use IIS at http://www.iis.net/. |
Why am I getting a ’call to undefined function: mysql_connect()’ error in my PHP script? |
|
Why am I getting a host blocked with mysqladmin flush-hosts error? |
However, you may need to raise a Support Ticket with our Customer Services team in order for the flush-hosts command to be performed. |
Why is MySQL 5 saying it can’t find a column that exists? |
If you are producing SQL that looks like: SELECT * FROM That can produce the error. It may look fine, and it did work in previous versions of MySQL, but the SQL standard means that MySQL 5 reads it as: SELECT * FROM Where the LEFT JOIN no longer makes any sense. To fix this problem, either move the JOIN statement so that it is between the two tables it is joining: SELECT * FROM Or explicitly group like ((a,b),c) instead of (a,(b,c)): SELECT * FROM |
How can I get my website or database back after I’ve accidentally deleted it? |
Our backups are generally taken every day early in the morning, writing over the previous week’s backups. This service is available only for our Shared Hosting customers and not for our Reseller or Server customers. Please look at our Snapshot Backups to prevent this from happening with your Server or Reseller account. |
What are valid connection strings on the Windows platform? |
MSAccess: Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db.mdb;User Id=admin;Password=; Driver={Microsoft Access Driver (*.mdb)};Dbq=db.mdb;Uid=Admin;Pwd=; MS-SQL (.NET Framework for SQL Server): To connect MS-SQL, you have a few options: Connecting to an MS-SQL Server database with OLE DB: Set objConn = Server.CreateObject(“ADODB.Connection”) As would be seen in web.config: <connectionStrings> Or connect to an MS-SQL Server database with SQL Driver: Set objConn = Server.CreateObject(“ADODB.Connection”) |
If you have a Technical Support question that you feel would enhance this page, please let us know.