What's new

Unable to select database.

tomekgim

User
Joined
Jun 18, 2008
Messages
41
Reaction score
0
Prosz? o pomoc wychodzi takie cos:
Code:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'root@localhost' (Using password: TAK) in C:\Program Files (x86)\WebServ\httpd\config.php on line 4
Unable to select database

Co zrobic? w config.php mam tak:

Code:
<?php
########## CONNECT DATABASE ##########
function connect_db(){
mysql_connect('localhost', 'root', 'tibia123');
mysql_select_db('zorzin') or die( "Unable to select database.");
}
########## END CONNECT DATABASE ##########

########## AAC SETTINGS ##########
$servpath = 'F:\\ot\\Evolutions 0.7.8 SQL'; //Server path.
$accesslvl = '3'; //Players above this group_id is not viewable in highscores.
$chartype = 'main'; //Rookgaard or main? Rookgaard = rook, Mainland = main
$charlenght = '30'; //Maxsize for character names.

$dont_show = array('Bisbal', 'Deathslicer', 'Noobing', 'monsters', 'Egipctothrower', 'Magicthrower', 'Plaguethrower', 'exp', 'Demon2', 'Flamethrower'); //These monsters are not avaliable in monsterlist.

$forum_show = '0'; // Display forum link on website? 1 = Yes 0 = No
$forumlink = "forum/index.php"; //Forum link
$gb_show = "1"; //Display guestbook link on website? 1 = Yes 0 = No
$worldname = "Swelia";
$title = 'Swelia'; // Title of webpages.
$housefile = 'Evolutions-house.xml'; //House file
$death_limit = '25'; //Death limit in latest deaths

$show_gods = '1'; //Display a list of gods on information page? 1 = Yes 0 = No
$show_gms = '1'; //Display a list of gms on information page? 1 = Yes 0 = No
$show_couns = '1'; //Display a list of counsellors on information page? 1 = Yes 0 = No
$show_stuts = '1'; //Display a list of senior tutors on information page? 1 = Yes 0 = No
$show_tuts = '1'; //Display a list of tutors on information page? 1 = Yes 0 = No

$sinds = "24 January 2007"; // type here the date when the counter started counting
$bestand = "teller.log"; // filename from the log file (Visitor counter)
$admin['pass'] = 'admin';    // Login password SQL Manager

$town_1 = 'Thais';
$town_2 = 'Carlin';
$town_3 = "Ab'Dendriel";
$town_4 = 'Edron';
$town_5 = 'Venore';
########## END AAC SETTINGS ##########

########## CHARACTER START SETTINGS ##########
##### ALL VOCATIONS #####
$pos_x = '1008'; //Starting posx
$pos_y = '1006'; //Starting posy
$pos_z = '7'; //Starting posz
$town_id = '1';  //Starting town id
$startlvl = '8'; //Starting level
$startexp = '4200'; //Starting experience

##### NO VOC SETTINGS #####
$novoc['cap'] = '470';
$novoc['hp'] = '2633';
$novoc['mag'] = '25';
$novoc['mana'] = '666';
### SKILLS ###
$novoc['fist'] = '10';
$novoc['club'] = '10';
$novoc['sword'] = '10';
$novoc['axe'] = '10';
$novoc['dist'] = '10';
$novoc['shield'] = '10';
$novoc['fish'] = '10';
### EQUIPMENT ###
$novoc['helmet'] = '';
$novoc['armor'] = '';
$novoc['leg'] = '';
$novoc['boot'] = '';
$novoc['amulet'] = '';
$novoc['ring'] = '';
$novoc['left'] = '';
$novoc['right'] = '';
$novoc['ammo'] = '';
$novoc['ammo_count'] = '';
$novoc['backpack'] = '';
$novoc['item1'] = '';
$novoc['item1_count'] = '';
$novoc['item2'] = '';
$novoc['item2_count'] = '';
$novoc['item3'] = '';
$novoc['item3_count'] = '';
##### END NO VOC SETTINGS #####

##### SORCERER SETTINGS #####
$sorc['cap'] = '470';
$sorc['hp'] = '185';
$sorc['mag'] = '0';
$sorc['mana'] = '35';
### SKILLS ###
$sorc['fist'] = '10';
$sorc['club'] = '10';
$sorc['sword'] = '10';
$sorc['axe'] = '10';
$sorc['dist'] = '10';
$sorc['shield'] = '10';
$sorc['fish'] = '10';
### EQUIPMENT ###
$sorc['helmet'] = '2491';
$sorc['armor'] = '2492';
$sorc['leg'] = '2488';
$sorc['boot'] = '2643';
$sorc['amulet'] = '2173';
$sorc['ring'] = '2179';
$sorc['left'] = '2412';
$sorc['right'] = '2524';
$sorc['ammo'] = '2120';
$sorc['ammo_count'] = '1';
$sorc['backpack'] = '1988';
$sorc['item1'] = '2554';
$sorc['item1_count'] = '1';
$sorc['item2'] = '2177';
$sorc['item2_count'] = '1';
$sorc['item3'] = '2169';
$sorc['item3_count'] = '1';
##### END SORCERER SETTINGS #####

##### DRUID SETTINGS #####
$druid['cap'] = '470';
$druid['hp'] = '185';
$druid['mag'] = '0';
$druid['mana'] = '35';
### SKILLS ###
$druid['fist'] = '10';
$druid['club'] = '10';
$druid['sword'] = '10';
$druid['axe'] = '10';
$druid['dist'] = '10';
$druid['shield'] = '10';
$druid['fish'] = '10';
### EQUIPMENT ###
$druid['helmet'] = '2491';
$druid['armor'] = '2492';
$druid['leg'] = '2488';
$druid['boot'] = '2643';
$druid['amulet'] = '2173';
$druid['ring'] = '2179';
$druid['left'] = '2412';
$druid['right'] = '2524';
$druid['ammo'] = '2120';
$druid['ammo_count'] = '1';
$druid['backpack'] = '1988';
$druid['item1'] = '2554';
$druid['item1_count'] = '1';
$druid['item2'] = '2177';
$druid['item2_count'] = '1';
$druid['item3'] = '2169';
$druid['item3_count'] = '';
##### END DRUID SETTINGS #####

##### PALADIN SETTINGS #####
$paladin['cap'] = '470';
$paladin['hp'] = '185';
$paladin['mag'] = '0';
$paladin['mana'] = '35';
### SKILLS ###
$paladin['fist'] = '10';
$paladin['club'] = '10';
$paladin['sword'] = '10';
$paladin['axe'] = '10';
$paladin['dist'] = '10';
$paladin['shield'] = '10';
$paladin['fish'] = '10';
### EQUIPMENT ###
$paladin['helmet'] = '';
$paladin['armor'] = '';
$paladin['leg'] = '';
$paladin['boot'] = '';
$paladin['amulet'] = '';
$paladin['ring'] = '';
$paladin['left'] = '';
$paladin['right'] = '';
$paladin['ammo'] = '';
$paladin['ammo_count'] = '';
$paladin['backpack'] = '';
$paladin['item1'] = '';
$paladin['item1_count'] = '';
$paladin['item2'] = '';
$paladin['item2_count'] = '';
$paladin['item3'] = '';
$paladin['item3_count'] = '';
##### END PALADIN SETTINGS #####

##### KNIGHT SETTINGS #####
$knight['cap'] = '470';
$knight['hp'] = '185';
$knight['mag'] = '0';
$knight['mana'] = '35';
### SKILLS ###
$knight['fist'] = '10';
$knight['club'] = '10';
$knight['sword'] = '10';
$knight['axe'] = '10';
$knight['dist'] = '10';
$knight['shield'] = '10';
$knight['fish'] = '10';
### EQUIPMENT ###
$knight['helmet'] = '';
$knight['armor'] = '';
$knight['leg'] = '';
$knight['boot'] = '';
$knight['amulet'] = '';
$knight['ring'] = '';
$knight['left'] = '';
$knight['right'] = '';
$knight['ammo'] = '';
$knight['ammo_count'] = '';
$knight['backpack'] = '';
$knight['item1'] = '';
$knight['item1_count'] = '';
$knight['item2'] = '';
$knight['item2_count'] = '';
$knight['item3'] = '';
$knight['item3_count'] = '';
##### END KNIGHT SETTINGS #####
########## END CHARACTER START SETTINGS ##########

########## DO NOT CHANGE ##########
$dirmonster = $servpath.'\\data\\monster/'; //monster dir
$dirworld = $servpath.'\\data\\world/'; //world dir
$dirdata = $servpath.'\\data/'; //data dir
$house = $servpath.'\\data\\world\\'.$housefile; //house file
$onlinelist = $servpath.'\\data\\logs\\online.php'; //Online list file
$fileitems = 'items.xml'; //items.xml for loot on monster page
$monsterimg = "img/monsterimg/"; //monster img dir on monster page
$fileitems = $servpath.'\\data\\items\\items.xml'; //Set path to items.xml here!
$spells_file = $servpath.'\\data\\spells\\spells.xml'; //spells.xml file
########## END DO NOT CHANGE ##########
?>
 

Yoxino

Advanced User
Joined
Aug 12, 2009
Messages
478
Reaction score
51
Odp: Unable to select database.

Napewno dobrze stworzy??? baz? danych i po??czy?e? si? z ni??
 

Misiekcrpv

User
Joined
Sep 3, 2009
Messages
16
Reaction score
0
Odp: Unable to select database.

No wi?c ja to widz? tak - w tej linijce
PHP:
mysql_connect('localhost', 'root', 'tibia123');
pobiera ci: lokacje bazy danych, jej u?ytkownika, jego has?o,a tak?e nazw? bazy danych
wi?c nawet je?eli nie masz has?a musi by? to zdefiniowane, bo w takim wypadku jak Ty masz to has?o jest tibia123, a nazw? bazy w og?le Ci nie pobiera.
Czyli zamiast tamtego wklej to:
PHP:
mysql_connect('localhost', 'root', '', 'tibia123');

Ups przepraszam nie doczyta?em i to raczej nie zadzia?a
 
Last edited:
Top