ResponsiveWeb Home > Hosting Plans > Virtual Hosting > FAQ > Details
MySQL FAQ
MySQL Configuration
If you have a Solaris or Linux web hosting account with us, please contact us to request our technical support group to setup a MySQL database for you and supply you with the database name, database host, username and password that you need to access the database.

If you have a dedicated server with us, running Red Hat Linux, the server already supports MySQL. 

Securing MySQL for the First time

The MySQL installation "out-of-box" is extremely insecure.  Before we start doing anything, we should create a root password to secure the configuration of the MySQL server.

shell> mysql -u root mysql
mysql> UPDATE user 
	SET Password=PASSWORD('new_password') 
	WHERE user='root';
mysql> FLUSH PRIVILEGES;

Or, you can do this:

shell> mysqladmin -u root password new_password

To check, do this:

shell> mysql -u root -p mysql

MySQL will then prompt for a password, use the new_password.

Setup new MySQL Database

To create a new MySQL database::

shell> mysqladmin -p create databasename

You will be prompted for the MySQL root password which you have setup previously.  Once the new database is created, you can assign a MySQL username and password to access it:

shell> mysql -u root -p mysql
mysql> grant all privileges on databasename.* 
	to username@localhost 
	identified by 'password';
mysql> FLUSH PRIVILEGES;

Depending on how you are connected to MySQL, You may also have to duplicate the username entry with this:

mysql> grant all privileges on databasename.* 
	to username@'%' 
	identified by 'password';
mysql> FLUSH PRIVILEGES;

To check, do this

shell> mysql -u username -p databasename

You will be prompted for a password, use the password you setup previously for the username.  Or, in Perl/DBI, you can use this:

$serverDb   = "databasename";
$serverName = "localhost";
$serverPort = "3306";
$serverUser = "username";
$serverPass = "password";
$dbh = DBI->connect("DBI:mysql:
	database=$serverDb;
	host=$serverName;
	port=$serverPort",
	$serverUser,$serverPass)
 



  Hot Tip
 did you know?



Dedicated Servers Dedicated Servers
Get A Quote for HIPAA, FISMA, and GLBA standards compliant applications & dedicated servers.
Budget Servers, Gaming Servers & High Performance Servers also available!
Our Racks Colocated Servers
Budget Racks: Your Servers, Network Switches, Remote Reboot Switches, & Appliances
Security Critical Locked Racks: FISMA, HIPAA, and GLBA Compliant
Unleash the Power of ResponsiveWeb's acclaimed CommerceBolt! E Commerce in a Box
ResponsiveWeb CommerceBolt: Amazon.com grade shopping cart!
Get listed in Froogle, Pricegrabber, Bizrate, & manage your inventory, shipments, orders, & more.
Web Design Web Design
Clean, Professional, and Effective. Web Design without the child's play.
Cutting Edge Design: starting at $299, with a Free Domain Name, Free Database, & Free Month of Hosting
VoIP Home & Office VoIP Telephone Services
Unlimited USA & Canada Calls: $20 per month; Canadian & USA phone numbers available. Special Offer to SMU Students
responsivEfax: efaxing, Toll Free: with virtual attendant and more, VoIP Office: our quote is 20% less your current carrier
Contact
Offices
24 Hilltop Road
Edison NJ 08820
 
86 Timberhill Drive
Franklin Park, NJ 08823
Datacenter
470 Vanderbilt Ave
Brooklyn NY 11238
Rapid Response
866-315-3263

More Contact Options