Why Mysql Isnt Connecting
trying to get php to connect with mysql so that I can start querying db(running locally on my machine and php works fine) however I'm having trouble. This is the error it spits out-
Warning: mysql_connect(): Access denied for user 'ODBC'@'localhost' (using password: NO) in D:phpwebconnect.php on line 5
Unable to connect to MySQL
Could anyone assist me on this matter.
View Complete Forum Thread with Replies
Related Forum Messages:
Connecting To Mysql But Not Connecting
I'm including a database connection file from another website. eg. include(http://domain1.com/dbc.inc.php) is in my page on domain2.com - now I tihnk both these domains are on the same server but I tihnk thats probably irrelevant. The issue is that the file includes and runs perfectly, it says it has successfully established a mysql connection, however when I try to use that connection it says there is no connection... or more correction it says Warning: mysql_query(): Access denied for user 'nobody'@'localhost' (using password: NO) in ... Warning: mysql_query(): A link to the server could not be established in... which usually means, you forgot to include your db script dummy. now I could just create 'dummy' pages that just have include(domain1.com/pagename.php) and that would work because we do a similar thing on other pages to grab the content.
View Replies !
PHP Not Connecting To MySQL?
I installed Apache 2.0.55, PHP 5.1.1, and MySQL 5.0.17 (in that order, on Windows XP). I have managed to get Apache and PHP working right, and MySQL by itself seems ok too. However, when I try to do any MySQL command within PHP, it just does nothing. No success, no error. I tried uncommenting the line "extension=php_mysql.dll", but when I restart Apache it tells me "PHP Startup: Unable to load dynamic library php_mysql.dll - The specified module could not be found.". No matter where I copy the file so that it can find it. No matter what I put in "extension_dir". What's wrong?
View Replies !
Connecting To Mysql With Php
I have been racking my brain trying to figure out what I am missing trying to follow this book to get a php script to work. I would really appreciate if someone could point out my errors. I've been up really late going over all the config files. Why do they always scim installation for the applications and put it in the Appendix when its the first thing that new users need to do. Then we run into these problems because the author takes so much for granted I'm using Apache 2.0.55 with PHP 5.1.2 and MySql AB 5.0.18. Windows XP SP2. What I believe I'm missing is how do I tell PHP & Apache where the Databases are?? Here is the pathing my my installs. C:/mysql/bin, c:/mysql/data/books, c:/apached/apache2/htdocs for servering up web pages, and c:/php. Here is the error log in apache, and the script ....
View Replies !
PHP Connecting To MySQL...
I am learning with Kevin Yanks book, "Build you Own Database Driven Website," and I have run into a problem. I have uploaded a PHP file to my local server, and none of my content is being displayed from my database. According to the book, the jokes that I have entered into my database should be displayed using this code. Here is the error I am getting: QuoteFatal Error: Call to undefined function mysql_connect() in C:.... on line 14 Code:
View Replies !
Connecting To A MySQL DB
When I try to connect to my database (myhomepageUsers) i get this error: Warning: mysql_connect() [function.mysql-connect (http://www.php.net/function.mysql-connect)]: Unknown MySQL server host 'myhomepageUsers' (11001) in c:program filese-novativeWAMPwwwmySQLindex.php on line 5 with this code:mysql_connect("myhomepageUsers"); I don't understand why this happens because the database exists.
View Replies !
Connecting Between PHP And MySQL
I've tried to run some textbook examples by moving them from the textbook CD to my HD, and running them through the local host. The trouble is that in this function function dbconnect ($dbname="test",$user="nobody",$password="",$server="localhost") I do not know where to store my sql database in in order for the PHP script to access the corresponding database. and the password and username... is the default in this manner?
View Replies !
Connecting In MySQL
I was wondering if there was any way to block specific IPs from connecting to MySQL? for example, I want all machines on my internal network to be allowed to connect except for one. I use 192.168.1.% in mysql.user table and it works fine. Is there a way to leave that and disallow just one host? Or must I remove that line and enter evry other IP on my network one by one.
View Replies !
Connecting To Mysql
I am trying to connect to mysql and am using the following function unsuccessfully: <?php mysql_connect("localhost", "dave", "skater") or die(mysql_error()); echo "Connected to MySQL<br />"; ?>
View Replies !
Connecting Dreamweaver To MySQL
I'm new to MySQL. I recently installed it as part of a preconfigured package (Apache, PHP and MySQL) from "Apache Friends (XAMPP). I was following a tutorial on connecting Dreamweaver to MySQL at http://www.macromedia.com/support/dr...sql_config.htm when I hit a snag. I think I created the MySQL username and password in the wrong directory, and it messed everything up. I reinstalled XAMPP and am giving it another try. But before I mess with the MySQL password again, I'd like to ask a couple questions. First, do I really need one? I'm only using MySQL on my computer, which no one else uses. I publish my sites to an ISP, which has their own MySQL program installed. Or is MySQL something that has to be customized and published along with your websites? This is what the Deramweaver instructions say about the password: "During the MySQL installation, MySQL creates an account called root with no password, which can be used to log into the database. It is highly recommended that a password is assigned to this account since root has full control over the MySQL databases. To assign the root account a password run the following command, which will set the root password to new-password. You should replace new-password with a password of your choice that is harder to guess." > mysqladmin -u root password new-password My next question regards this statement: "It is recommended that separate MySQL accounts are created for each PHP web application. You can create as many MySQL accounts as you wish and assign different rights and permissions to each account. Web application users do not need the same level of privileges as the root account." When they say "each PHP web application," do they mean create a separate MySQL account for each WEBSITE? Does that mean I have to create a new MySQL password for each of my websites and connect it to Dreamweaver individually? I also have PHPMyAdmin installed, but I haven't learned how to use it yet. When I click "Test PHPMyAdmin," I get a page that has a setting labeled "Create new database." There's also a link to "Privileges," which leads to a page with keywords like "user," "password," "root" and "edit." Maybe I should use one of these pages to add a MySQL password (if necessary). But I thought I should first ask if it's NECESSARY to create a password for MySQL.
View Replies !
PHP & MySQL - Connecting Two Databases
I am trying to understand the best way to extract a list of users from a table based upon their location. To do this I have a table containing all the UK postcodes with a grid reference x & y. postcode x y AB10 392900 804900 AB11 394500 805300 AB12 393300 801100 AB13 385600 801900 AB14 383600 801100 AB15 390000 805300 AB16 390600 807800 AB21 387900 813200 AB22 392800 810700 AB23 394700 813500 AB25 393200 806900 AB30 370900 772900 In a seperate table I have a list of users including a postcode. id firstname postcode 1 Heather BH4 2 Vicky OL1 3 Paola CF8 4 Joanna W14 5 Steve BD13 6 Sally NN1 In short I would like your opinoin on how best (most efficiently) to calculate the nearest 20 users. The method I am using to calculate the distance between the users and any chosen postcode is good old Pythagoras dist = sq root ( (userX * userX) + (userY * userY) - (locationX * locationX) + (locationY * locationY) ) It seems that looping through the users to first calculate the distance is essential. After that point I am not sure about the besr way to proceed. Do I write the results to a temp table (with distances) then call them in order of distance or is there a better way?
View Replies !
Error When Connecting To MySQL
I just created a database with no tables that is located on the same server as the website. I made a page with a small script to verify that I was connected tot he database. I am not familiar with the php errors so maybe someone could give me a hint as to what this means: ********* The Script *************** <?php $link = mysql_connect("localhost", "username", "password") or die("Could not connect: " . mysql_error()); print ("Connected successfully"); mysql_close($link);?> *********The Error***************** Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /var/www/html/test.php on line 10 Could not connect: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) *********************************
View Replies !
Problems Connecting To MySQL
I just installed PHP 5.0.4, Apache 2.0.54, and MySQL 4.1.13 a few days ago on WinXP SP2. My goal is to learn to use these programs. I cannot, absolutely cannot connect to MySQL using PHP. I've tried everything possible including the mysqli functions. I have no idea what is wrong. I don't get any error messages at all. It's almost as if PHP stops processing the php file in mid stream. PHP is installed properly (I followed the installation instructions to the letter). Simple php files process OK. MySQL is installed fine--I've loaded data from an Access table and have been querying it fine using the MySQL Query Browser. But I cannot connect to MySQL using PHP! I am thinking that someone could create a simple DB with one table in it with a little bit of text in one of the fields (as a test), then write some PHP code that they KNOW works. Then I'll set up a DB the same and run that PHP code and see if it works on my system.
View Replies !
Connecting To Mysql Using Pear DB
I'm new to using PEAR and I'm trying to connect to a mysql database using it's DB package. Here's the code I have: Code: require '/usr/local/lib/php/DB.php' $dbh = DB::connect('mysql://myusername:mypassword@localhost/mydb'); print "Connected to 'mydb'"; It seems to load the DB.php file properly because if I comment out line 2, it displays line 3 without any errors. However, when I try to connect to mysql, the page is blank. No errors, nothing.
View Replies !
Connecting To Mysql - ODBC
I dont know whether this is the right forum to ask this question. I would like to copy the table contents from AS/400 DB2 to MySQL table. For example i have a table in DB2 called JDEdatabase.table1 and would like to copy/transfer the contents to MySQL called MySQLdatabase.table1. I already created the table1 in MySQL similar to JDEdatabase.table1. I already installed and connected with MySQL ODBC 3.51 Driver. How do i need to connect with both the servers and transfer the data from JDEdatabase.table1 to MySQLdatabase.table1 using php?. Code:
View Replies !
Is My Script Connecting To MySQL Correctly?
My first php script involves logining in to a site. I used a tutorial from a book and it doesn't seem to be working correctly. The code is below I started with a simple form to insert a username and password ------------------------------------------------ quote:<?php pass.form.php ?> <html> <head><title> User Authentication</title></head> <body bgcolor="white"> <h2>Please Log in </h2> <form method="post" action="pass.login.php"> USERNAME: <input type="text" name="user"><br> PASSWORD: <input type="password" name="pass"><br> <input type="submit" value="log in"> </form> </body> </html> ------------------------------------------------ next comes the login script ------------------------------------------------ quote:<?php /* verifies username and password */ // set up variables define ('HOST', 'localhost'); define ('USER', 'root'); define ('PASS', '*******'); define ('DB', 'comp390'); //connect and get numfound mysql_connect(HOST, USER, PASS); mysql_select_db(DB); $result = mysql_query("SELECT COUNT(*) AS numfound FROM users WHERE user='{$HTTP_POST_VARS['user']} AND pass='{$HTTP_POST_VARS['pass']}'"); //Decide what we're going to allow $result_ar = @mysql_fetch_array($result); if ($result_ar['numfound'] < 1) // ***** LOGIN FAILED ****** { header('Location: pass.form.php?error=1'); } else // ***** LOGIN succeeded!! ***** { echo "Logged in Successfully!"; } ?> ------------------------------------------------ now I have a database set up, comp390. A table called users so as far as I can see that is ok. I have populated the DB with a few users giving each a password and I can't get the script to echo... Logged in Successfully. Even when I use the correct usernames and password. So before I go any furthur and improve the script I need to sort this problem out.
View Replies !
Connecting To Seperate MySQL Server Through PHP
We currently have our mySQL server on the same box as the Apache server. For security and load balancing, we're going to be moving the mySQL server to another box. We're already using a single included connection file in all of our PHP pages that has the server, username, password line that connects to the database. Aside from changing "localhost" to the IP/port number of the new server, what else should be done, especially in the security sense? If someone were to hack and be able to get access to view files, they could open that file and see the username/password. Is there some way to encrypt it or something? So far the only thing I can think of to help limit that file's exposure is to place it outside the /var/www/htdocs folder region. And of course make sure the mySQL account it's connecting to has only the mySQL permissions it needs.
View Replies !
Connecting Two Mysql Tables From Different Databases
How would you connect two tables from 2 different databases using PHP scripts? Because, one database that contains customer table is dedicated to one project, and then here comes another project that also uses the customer table...the clients dont want to reenter all of values from the first database to the second database. Dumping would not be an option cause they want the two projects to run in different databases... and whenever the user made changes to the customer table from the first database, it should also affect the customer table from the second database.
View Replies !
Connecting To Two Mysql Servers Simulanteously
we had our db server crash (again) and lost some data in the process, and i was thinking for the new system we're making, why not write simultaneously to two different mysql db's on two different servers? that way, if one crashed, we'd have a real time backup that we could move over with very little downtime. is it possible to have two open connections to two databases and then tell mysql which connection to use for which insert statement? and is there a server it would default to so i wouldn't have to declare which server to get all my select statements from?
View Replies !
Connecting To MySQL Using Sessions Info
I have a password protected webpage using sessions. Once the password has been checked, I want to used the stored sessions username to get user specific information from my database. I cannot get the WHERE section of SELECT*FROM ...WHERE to work. Here is the login code:
View Replies !
Connecting To MySQL With Alternate Sock
I have taken a look around and haven't found an answer suitable for me. I need to connect to a MySQL db through an alternate sock file. I can not edit any php config files like php.ini. I tried the following just hoping it would work...but it didn't. Code:
View Replies !
Troubling Connecting To A MYSQL Database
I have installed PHP and mySQL... and followed the instructions to a T... PHP i know works.. I mysql seem to instal fine... but when I run some PHP to see if it will connect to the mysql database I get a HTTP 500 Internal Server Error? Code:
View Replies !
Connecting To Remote Mysql Database
I am trying to connect to a remote database on another one of my servers. I can't seem to get it to make the connection. It gives me a timeout error. The mysql port is open (I commented out the skip-networking option in the my.cnf file). What else do I have to do to enable this user to access the db on the remote server? Do I have to change the users permissions?
View Replies !
Access Denied Connecting To Mysql
im trying to connect to my mysql server $this->dblink = mysql_connect("kemistry","root","password"); this gives me an error: PHP Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root '@'Server' (using password: YES) in c:InetpubwwwrootServerlibforumDB.php on line 20 i created a new root@Server and im using the correct password but im still getting the access denied error. what am i doing wrong?
View Replies !
Remote MySQL Database Connecting Problem
I have a problem. I have a database on a server x, and a website hosted on the same server which works perfect. I am trying to use the same database on server x from server y. When I try to connect remotely, I enter the server domain/IP instead of localhost, and it gives the error below: Warning: Warning: mysql_connect(): Access denied for user: 'myusername@newserverip' (Using password: YES) in /home/mydatabaseconnectionfile.php on line 72 Could not connect : Access denied for user: 'mysqlusername@newserverip' (Using password: YES) What do you recommend? What I understand is this hosting on server X, does not allow remote connections to teh database. Is there some sort of Tunnelling I can use to connect? Both servers are Shared Hosting plans, so I do not have access to do anything except FTP into my accounts.
View Replies !
Connecting To MySQL Without Storing Password In Clear Text
I have a website in a Linux/Apache shared hosting environment and have been given access to the MySQL server running on the same machine. To access this database from PHP, I have to call mysql_connect(host, user, password) where the password is hardcoded into my PHP source file in clear text. I see two security problems with this: 1) Since the PHP source is in my public webserver area, another user of the same server could telnet into the server and look at the source file and see the password file. I can't lock the file down using Unix file system permissions or else the webserver won't be able to read it. 2) If my ISP messes up their webserver config and accidentally stops parsing PHP files and outputs the PHP file as plain text, the password will be visible to all. Is there any other way for PHP to authenticate itself to MySQL?
View Replies !
Isnt ^ Common Regex Notation?
isnt ^ common regex notation? keep getting this error: Parse error: syntax error, unexpected '^' Code: $goalsheet.=preg_replace("/^[0-9]+ Year Career Goal #[0-9]+: *$", "/^<span class=hd2>[0-9]+ Year Career Goal #[0-9]+: *</span><br>$/", $goallist); aside from the error, i think the regex is off, but i hav had a hard time finding a tutorial that explains how I can ignore text in the middle. Here are some examples of what i'm trying to do: "1 Year Goal #1: Web Developer" -> "<span>1 Year Goal #1: Web Developer</span><br>" "10 Year Goal #2: IT Consultant" -> "<span>10 Year Goal #2: IT Consultant</span><br>" suggestions?
View Replies !
INSERT Code Isnt Working.
This probably has a really simple answer, but my INSERT code isnt working. mysql_query('INSERT INTO `members` (`id`, `uname`, `uemail`, `upass`, `GUID`, `data`, `permissions`) VALUES ('NULL', $psuser, $psemail, $psPassword, 'NULL', 'NULL', Ƈ')'); And I get an error saying unexpected T_STRING .
View Replies !
How Do Sessions Work Cos Mine Isnt Working?
How do sessions work cos mine isnt working i got this: on a different page i have : $_SESSION['referer'] = '1'; then: if ($_SESSION['referer'] == '1'){ include ("include.php"); } but when i echo session it is blank =/ what did i do wrong.. i got many other sessions on the go so it should work..
View Replies !
Script Isnt Pulling The Basename From Upload
This upload script im using for some reason wont pull the file name and database it when you go to upload a file and it wont upload the file either... I used this script before and got it to work but for some reason it wont work now.. I checked the other forms and they still work so i must be missing something in the script. Code:
View Replies !
Simple Image Upload Isnt Working?
im working on a simple image upload script (my first try) well i noticed that for some reason its not even recognizing a file being uploaded...ive tried using the phpfreaks simple image upload tutorial but that wont seem to work for me. Code:
View Replies !
INSERT Short Record = Fine, Long One Isnt
I have a mysql database table that I created by copying another one in phpadmin. The first table works fine. the second table works fine when I insert a short record, but when I do a long one it doesn't appear in the database. any idea what I'm doing wrong? It's not that its truncating the record, there is nothing there.
View Replies !
Security Code Image In PHPNuke Login Isnt Displaying
i installed the PHP Nuke in a remote web space bought from prackhost.Problem is that iam not able to get the security code to login to the site as admin or normal user. All the remaining images like links and logo are comming except that security code. Iam not able to do any furthur action.
View Replies !
Php & Connecting
For example I have an IP : port and on connect (for example using telnet) it shows me some info (like current air temp) and after it closing connection. How can i insert it on my web page using PHP? And on every visit on this page php connects to this IP, gather this info and shows it on page?
View Replies !
Connecting To Db..
this seems pretty straight-forward.. got this code $link = mysql_connect('localhost:3306', '<uid>', '<pswd>'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully' mysql_close($link); from here.. http://us2.php.net/function.mysql-connect but can't connect, get this error: Connect to db: Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in C:xamppxampphtdocshomeconn.php on line 19 Could not connect: Can't connect to MySQL server on 'localhost' (10061) I connect to this same MySQL server from Tomcat w/no problem.. what is issue here pls... now on top of pg mentioned above, there this description: resource mysql_connect ( [string server [, string username [, string password [, bool new_link [, int client_flags]]]]] ) what does 'resource' refer to here pls... and where to do specify what db to connect to... (in java you put db-name in same line where you make the connection..) (and don't you need a driver to connect, I use a JDBC driver to connect w/Java..)
View Replies !
Connecting To An API
I need to use a company's API in order to try and convert video files into flash files and then play them Youtube style. There is a set API to use, but the instructions are incredibly vague, and me being new to APIs in general, I have absolutely no idea where to start to get the results. I can program basic PHP forms and database stuff, but this is all new to me. Code:
View Replies !
Connecting To FTP
I'm trying to connect with FTP to run a CHMOD command or whatever you want to call it with PHP. PLEASE READ THIS: http://codingforums.com/showthread.php?p=504574&posted=1#post504574 There it will explain exactly what I'm trying to do... But for now, I'll give you the 411. I've erased all coding and I'm starting from scratch just for testing. So, basically, all that coding you saw on the previous page is worthless for now. PHP.net MANUAL - CHMOD: http://us3.php.net/manual/en/function.chmod.php If you scroll down on that page, you'll see how they connected with FTP. I don't understand much of any of it... So, basically, what does every each and every part of that coding mean? How does it work when it's all put together?
View Replies !
Connecting To DB
I was using MySQL, but now our hosting company doesn't support MySQL so I am having to use it instead. I can't seem to connect to the DB. I have used the mssql_connect instead of mysql_connect but I get this error: PHP Fatal error: Call to undefined function: mssql_connect() in db_config.php on line 2. The hosting company seems to be a pain in the butt to deal with for tech support so if this is an error on my side I would rather resolve it without having to contact them.
View Replies !
Connecting To A Different Host
Is there anyway to connect to a given host from a form and do all the processing of information and calculations at that host and then display the results on the clients computer? I was thinking of a socket connection but I don't know if that would work well. Any suggestions would be appreciated.
View Replies !
Memcache Not Connecting
memcache appears to be installed correctly, but when I use memcache_connect I get the following error: Warning: memcache_connect(): Can't connect to localhost:11211, Unknown error (0) I'm connecting using the following command: $memcache_obj = memcache_connect('localhost', 11211); Memcache info from phpinfo(): memcache memcache support enabled Active persistent connections 0 Revision $Revision: 1.53 $ Directive Local Value Master Value memcache.allow_failover 1 1 memcache.chunk_size 8192 8192 memcache.default_port 11211 11211 Finally, var_dump(extension_loaded('memcache')); returns true.
View Replies !
|