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 10 Pro 64bit) (Wampserver 3.1.7 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 6.3.10>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

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.