how to get server name and db variable for wamp?
Posted by: jaz (121.121.60.---)
Date: March 09, 2017 02:30PM

Hi guys, how to get server name and db variable for wamp?
Thanks in advance!

// Database Variables (edit with your own server information)

$server = 'localhost';

$user = 'root';

$pass = '';

$db = 'mysql';

Options: ReplyQuote
Re: how to get server name and db variable for wamp?
Posted by: RiggsFolly (Moderator)
Date: March 09, 2017 03:12PM

This is a correct
$server = 'localhost';

Although it can achieve better access speed if you use
$server = '';

There is a MYSQL account named root by default on WAMPServer
$user = 'root';
so you could use this.
It would be better to create a new MYSQL user account, with a password, for each site you add to WAMPServer, but you can do this.

By default the root account has no password so this is correct as long as you have not placed a password on this account
$pass = '';

This is definitely WRONG
$db = 'mysql';
as this is the name of the database that MYSQL uses to manage itself. Never use this database name

This parameter is supposed to be the NAME that you gave your database when you created the database you want to use for this site/project. Remember MYSQL can manage many databases within a single instance of MYSQL

I would suggest you start your career as a web developer by doing a google search on "MYSQL for beginners" and doing some reading before you get yourself into any trouble.
MYSQL is not a trivial DBMS and you should at least be familiar with its basic operation before starting to use it.
Pay special attention to learning how to take backups of you databases, 2 minutes spent backing up a databse save HOURS of pain and DAYS of time wasted if you ever get problems.

(Windows 7 Pro 32bit) (Wampserver 3.0.6 32bit)
<Apache 2.4.23/2.2.31> <PHP 7.1.2/7.0.16/5.6.28/5.5.38/5.4.45/5.3.29> <MySQL 5.7.10/5.6.17/5.5.28>
<MariaDB 10.1.21> <phpMyAdmin4.6.5.2> <MySQL Workbench>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin -- WAMPServer alternate Repo
-?-?-?- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -?-?-?-

Edited 3 time(s). Last edit at 03/09/2017 03:14PM by RiggsFolly.

Options: ReplyQuote

Sorry, only registered users may post in this forum.