473,748 Members | 2,244 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connect to mysql?

Hi!

I have a question. I have installed php and mysql on an apache-server on
windows and I can't connect to the server.

I tried to create a database (since I am trying to learn howto). My manual
said I should write this at the shell:
c:\mysql\bin>my sqladmin -u root creare mindb

I did this and got this error:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localho st' (using password: NO)'

I then tried to use -p and wrote this instead:
c:\mysql\bin>my sqladmin -p -u root creare mindb

The database was created!

Then I tried to write mysql in cmd at c:\mysql\bin but I get this error:
Access denied for user 'ODBC'@'localho st' (using password: No)

Why??

I have used earlier versions of mysql and php and got it to work. In earlier
versions "my.ini" looks very different and user and password were written
there, but not anymore. Why, or is it me who have done something wrong? When
I log in to phpmyadmin I have to root-accounts there, one with
host=localhost and one the host=%.

All I want, is to make mysql work, so I can test things and to learn!

Thanks
Cassandra

My configuration
Windows XP pro

Netgear router (I have opened port 3306)

ADSL

no-ip (For my domain, www.kamrate.se)
Apache 2.2.2

The exe-files are in c:\apache2\bin

(All I did was to fill in domain=localhos t, servername=loca lhost and my
email)
PHP 5.1.4

The exe-files are in c:\php

(I used the zip package)
httpd.conf

At the row below "#LoadModul e ssl_module modules/mod_ssl.so" I wrote:

LoadModule php5_module "c:/php/php5apache2_2.d ll
At the row below "AddType application/x-gzip .gz .tgz" I wrote:

AddType application/x-httpd-php .php
At the row below "DocumentRo ot" I wrote:

PHPIniDir "C:/php"
At the row below "DocumentRo ot" I wrote:

PHPIniDir "C:/php"
At the row "DirectoryI ndex index.html" I wrote:

DirectoryIndex index.htm index.html index.php
php.ini

Changed "doc_root" to:

c:\Apache2\htdo cs
Created a tmp-folder in:

c:\apache2\ and wrote the path in session.save_pa th:

c:\apache2\tmp
Saved php.ini in:

c:\php
I did restart apache and tested php and it worked!
Mysql 5.0.22

The exe-files are in c:\mysql\bin
Removed earlier versions of mysql, including the folder:

c:\mysql
I did choose to run "Configurat ion Wizard" and did choose a password for
root.
PhpMyAdmin

Installationfol der is "c:\apache2\htd ocs"

I wrote host=localhost, user=root and password in config.inc.php.
php.ini

I removed the ; before "extension=php_ mysql.dll"

I removed the ; before "extension=php_ mbstring.dll"
At the row "extension_ dir" I wrote:

extension_dir=" c:\php\ext"
I copied libmysql.dll in c:\mysql\bin to:

c:\apache2\bin
I did restart apache and tested to surf to http://localhost/phpmyadmin and
it worked!


Jun 29 '06 #1
5 4570
Could you try next thing:

cd C:\Program Files\MySQL\MyS QL Server 5.0\bin
mysql -h localhost -u root -p

use mindb

GRANT ALL PRIVILEGES ON *.* TO 'ODBC'@'localho st' IDENTIFIED BY 'yourpass' WITH GRANT OPTION;
news.telia.net wrote:
Hi!

I have a question. I have installed php and mysql on an apache-server on
windows and I can't connect to the server.

I tried to create a database (since I am trying to learn howto). My manual
said I should write this at the shell:
c:\mysql\bin>my sqladmin -u root creare mindb

I did this and got this error:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localho st' (using password: NO)'

I then tried to use -p and wrote this instead:
c:\mysql\bin>my sqladmin -p -u root creare mindb

The database was created!

Then I tried to write mysql in cmd at c:\mysql\bin but I get this error:
Access denied for user 'ODBC'@'localho st' (using password: No)

Why??

I have used earlier versions of mysql and php and got it to work. In earlier
versions "my.ini" looks very different and user and password were written
there, but not anymore. Why, or is it me who have done something wrong? When
I log in to phpmyadmin I have to root-accounts there, one with
host=localhost and one the host=%.

All I want, is to make mysql work, so I can test things and to learn!

Thanks
Cassandra

My configuration
Windows XP pro

Netgear router (I have opened port 3306)

ADSL

no-ip (For my domain, www.kamrate.se)
Apache 2.2.2

The exe-files are in c:\apache2\bin

(All I did was to fill in domain=localhos t, servername=loca lhost and my
email)
PHP 5.1.4

The exe-files are in c:\php

(I used the zip package)
httpd.conf

At the row below "#LoadModul e ssl_module modules/mod_ssl.so" I wrote:

LoadModule php5_module "c:/php/php5apache2_2.d ll
At the row below "AddType application/x-gzip .gz .tgz" I wrote:

AddType application/x-httpd-php .php
At the row below "DocumentRo ot" I wrote:

PHPIniDir "C:/php"
At the row below "DocumentRo ot" I wrote:

PHPIniDir "C:/php"
At the row "DirectoryI ndex index.html" I wrote:

DirectoryIndex index.htm index.html index.php
php.ini

Changed "doc_root" to:

c:\Apache2\htdo cs
Created a tmp-folder in:

c:\apache2\ and wrote the path in session.save_pa th:

c:\apache2\tmp
Saved php.ini in:

c:\php
I did restart apache and tested php and it worked!
Mysql 5.0.22

The exe-files are in c:\mysql\bin
Removed earlier versions of mysql, including the folder:

c:\mysql
I did choose to run "Configurat ion Wizard" and did choose a password for
root.
PhpMyAdmin

Installationfol der is "c:\apache2\htd ocs"

I wrote host=localhost, user=root and password in config.inc.php.
php.ini

I removed the ; before "extension=php_ mysql.dll"

I removed the ; before "extension=php_ mbstring.dll"
At the row "extension_ dir" I wrote:

extension_dir=" c:\php\ext"
I copied libmysql.dll in c:\mysql\bin to:

c:\apache2\bin
I did restart apache and tested to surf to http://localhost/phpmyadmin and
it worked!


Jun 29 '06 #2
I tried it and it worked. What does -h mean?

I have 2 (4) users for mysql and it is "root" (local and %) with a passord
and "cassandra" (local and %) without a password, that I did create a while
ago because someone did explain that I should do that. What is the
difference between these 2 users, root and cassandra? Which user should I
use and why? Should I have both users and should "cassandra" have a
password?

I tried to us DBDesigner 4 and I get error when I try to connect to a
database with "root" but not when I use "cassandra" . Why?

Thanks


cd C:\Program Files\MySQL\MyS QL Server 5.0\bin
mysql -h localhost -u root -p

use mindb

GRANT ALL PRIVILEGES ON *.* TO 'ODBC'@'localho st' IDENTIFIED BY 'yourpass' WITH GRANT OPTION;

news.telia.net wrote:
Hi!

I have a question. I have installed php and mysql on an apache-server on
windows and I can't connect to the server.

I tried to create a database (since I am trying to learn howto). My manual said I should write this at the shell:
c:\mysql\bin>my sqladmin -u root creare mindb

I did this and got this error:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localho st' (using password: NO)'

I then tried to use -p and wrote this instead:
c:\mysql\bin>my sqladmin -p -u root creare mindb

The database was created!

Then I tried to write mysql in cmd at c:\mysql\bin but I get this error:
Access denied for user 'ODBC'@'localho st' (using password: No)

Why??

I have used earlier versions of mysql and php and got it to work. In earlier versions "my.ini" looks very different and user and password were written there, but not anymore. Why, or is it me who have done something wrong? When I log in to phpmyadmin I have to root-accounts there, one with
host=localhost and one the host=%.

All I want, is to make mysql work, so I can test things and to learn!

Thanks
Cassandra

My configuration
Windows XP pro

Netgear router (I have opened port 3306)

ADSL

no-ip (For my domain, www.kamrate.se)
Apache 2.2.2

The exe-files are in c:\apache2\bin

(All I did was to fill in domain=localhos t, servername=loca lhost and my
email)
PHP 5.1.4

The exe-files are in c:\php

(I used the zip package)
httpd.conf

At the row below "#LoadModul e ssl_module modules/mod_ssl.so" I wrote:

LoadModule php5_module "c:/php/php5apache2_2.d ll
At the row below "AddType application/x-gzip .gz .tgz" I wrote:

AddType application/x-httpd-php .php
At the row below "DocumentRo ot" I wrote:

PHPIniDir "C:/php"
At the row below "DocumentRo ot" I wrote:

PHPIniDir "C:/php"
At the row "DirectoryI ndex index.html" I wrote:

DirectoryIndex index.htm index.html index.php
php.ini

Changed "doc_root" to:

c:\Apache2\htdo cs
Created a tmp-folder in:

c:\apache2\ and wrote the path in session.save_pa th:

c:\apache2\tmp
Saved php.ini in:

c:\php
I did restart apache and tested php and it worked!
Mysql 5.0.22

The exe-files are in c:\mysql\bin
Removed earlier versions of mysql, including the folder:

c:\mysql
I did choose to run "Configurat ion Wizard" and did choose a password for
root.
PhpMyAdmin

Installationfol der is "c:\apache2\htd ocs"

I wrote host=localhost, user=root and password in config.inc.php.
php.ini

I removed the ; before "extension=php_ mysql.dll"

I removed the ; before "extension=php_ mbstring.dll"
At the row "extension_ dir" I wrote:

extension_dir=" c:\php\ext"
I copied libmysql.dll in c:\mysql\bin to:

c:\apache2\bin
I did restart apache and tested to surf to http://localhost/phpmyadmin and it worked!


Jun 29 '06 #3
news.telia.net wrote:
Hi!

I have a question. I have installed php and mysql on an apache-server on
windows and I can't connect to the server.

I tried to create a database (since I am trying to learn howto). My manual
said I should write this at the shell:
c:\mysql\bin>my sqladmin -u root creare mindb

I did this and got this error:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localho st' (using password: NO)'

I then tried to use -p and wrote this instead:
c:\mysql\bin>my sqladmin -p -u root creare mindb

The database was created!

Then I tried to write mysql in cmd at c:\mysql\bin but I get this error:
Access denied for user 'ODBC'@'localho st' (using password: No)

Why??

I have used earlier versions of mysql and php and got it to work. In earlier
versions "my.ini" looks very different and user and password were written
there, but not anymore. Why, or is it me who have done something wrong? When
I log in to phpmyadmin I have to root-accounts there, one with
host=localhost and one the host=%.

All I want, is to make mysql work, so I can test things and to learn!

Thanks
Cassandra

My configuration
Windows XP pro

Netgear router (I have opened port 3306)

ADSL

no-ip (For my domain, www.kamrate.se)
Apache 2.2.2

The exe-files are in c:\apache2\bin

(All I did was to fill in domain=localhos t, servername=loca lhost and my
email)
PHP 5.1.4

The exe-files are in c:\php

(I used the zip package)
httpd.conf

At the row below "#LoadModul e ssl_module modules/mod_ssl.so" I wrote:

LoadModule php5_module "c:/php/php5apache2_2.d ll
At the row below "AddType application/x-gzip .gz .tgz" I wrote:

AddType application/x-httpd-php .php
At the row below "DocumentRo ot" I wrote:

PHPIniDir "C:/php"
At the row below "DocumentRo ot" I wrote:

PHPIniDir "C:/php"
At the row "DirectoryI ndex index.html" I wrote:

DirectoryIndex index.htm index.html index.php
php.ini

Changed "doc_root" to:

c:\Apache2\htdo cs
Created a tmp-folder in:

c:\apache2\ and wrote the path in session.save_pa th:

c:\apache2\tmp
Saved php.ini in:

c:\php
I did restart apache and tested php and it worked!
Mysql 5.0.22

The exe-files are in c:\mysql\bin
Removed earlier versions of mysql, including the folder:

c:\mysql
I did choose to run "Configurat ion Wizard" and did choose a password for
root.
PhpMyAdmin

Installationfol der is "c:\apache2\htd ocs"

I wrote host=localhost, user=root and password in config.inc.php.
php.ini

I removed the ; before "extension=php_ mysql.dll"

I removed the ; before "extension=php_ mbstring.dll"
At the row "extension_ dir" I wrote:

extension_dir=" c:\php\ext"
I copied libmysql.dll in c:\mysql\bin to:

c:\apache2\bin
I did restart apache and tested to surf to http://localhost/phpmyadmin and
it worked!



Maybe ask in a MySQL newsgroup, such as comp.databases. mysql?
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jun 30 '06 #4
> I tried it and it worked. What does -h mean?
mysql --help

I have 2 (4) users for mysql and it is "root" (local and %) with a passord
and "cassandra" (local and %) without a password, that I did create a while
ago because someone did explain that I should do that. What is the
difference between these 2 users, root and cassandra? Which user should I
use and why? Should I have both users and should "cassandra" have a
password?

http://dev.mysql.com/doc/refman/5.0/en/security.html

Don't want to be rude, but this has nothing to do with PHP and thise type of questions should be asked in MySQL forum.
Best regards,
Garbage Monster
Jul 1 '06 #5
Regarding you question about DBDesigner 4 (from alt.comp.databa ses.mysql):

=============== = post 1 =============== ===========
Known bug I'm afraid. The only way I know is to use MySql via ODBC, try it,
it works for me as I had the same problem.
=============== = post 2 =============== ===========
You might want to google for this one - it's a known problem when the
MySQL client lib is older than the server or vice versa. MySQL changed
the password encrytion method at some point. There's an option for the
server (--old-password or something like that) that re-establishes the
old behaviour. That should make it work with DBDesigner.

However, AFAIK this product is no longer actively developed. I doubt
that it'll be able to take advantages of the new features in MySQL 5
and afterwards (Stored Procedures, Triggers, Views ...)


news.telia.net wrote:
I tried it and it worked. What does -h mean?

I have 2 (4) users for mysql and it is "root" (local and %) with a passord
and "cassandra" (local and %) without a password, that I did create a while
ago because someone did explain that I should do that. What is the
difference between these 2 users, root and cassandra? Which user should I
use and why? Should I have both users and should "cassandra" have a
password?

I tried to us DBDesigner 4 and I get error when I try to connect to a
database with "root" but not when I use "cassandra" . Why?

Thanks


cd C:\Program Files\MySQL\MyS QL Server 5.0\bin
mysql -h localhost -u root -p

use mindb

GRANT ALL PRIVILEGES ON *.* TO 'ODBC'@'localho st' IDENTIFIED BY 'yourpass'

WITH GRANT OPTION;

news.telia.net wrote:
Hi!

I have a question. I have installed php and mysql on an apache-server on
windows and I can't connect to the server.

I tried to create a database (since I am trying to learn howto). My manual said I should write this at the shell:
c:\mysql\bin>my sqladmin -u root creare mindb

I did this and got this error:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localho st' (using password: NO)'

I then tried to use -p and wrote this instead:
c:\mysql\bin>my sqladmin -p -u root creare mindb

The database was created!

Then I tried to write mysql in cmd at c:\mysql\bin but I get this error:
Access denied for user 'ODBC'@'localho st' (using password: No)

Why??

I have used earlier versions of mysql and php and got it to work. In earlier versions "my.ini" looks very different and user and password were written there, but not anymore. Why, or is it me who have done something wrong? When I log in to phpmyadmin I have to root-accounts there, one with
host=localhost and one the host=%.

All I want, is to make mysql work, so I can test things and to learn!

Thanks
Cassandra

My configuration
Windows XP pro

Netgear router (I have opened port 3306)

ADSL

no-ip (For my domain, www.kamrate.se)
Apache 2.2.2

The exe-files are in c:\apache2\bin

(All I did was to fill in domain=localhos t, servername=loca lhost and my
email)
PHP 5.1.4

The exe-files are in c:\php

(I used the zip package)
httpd.conf

At the row below "#LoadModul e ssl_module modules/mod_ssl.so" I wrote:

LoadModule php5_module "c:/php/php5apache2_2.d ll
At the row below "AddType application/x-gzip .gz .tgz" I wrote:

AddType application/x-httpd-php .php
At the row below "DocumentRo ot" I wrote:

PHPIniDir "C:/php"
At the row below "DocumentRo ot" I wrote:

PHPIniDir "C:/php"
At the row "DirectoryI ndex index.html" I wrote:

DirectoryIndex index.htm index.html index.php
php.ini

Changed "doc_root" to:

c:\Apache2\htdo cs
Created a tmp-folder in:

c:\apache2\ and wrote the path in session.save_pa th:

c:\apache2\tmp
Saved php.ini in:

c:\php
I did restart apache and tested php and it worked!
Mysql 5.0.22

The exe-files are in c:\mysql\bin
Removed earlier versions of mysql, including the folder:

c:\mysql
I did choose to run "Configurat ion Wizard" and did choose a password for
root.
PhpMyAdmin

Installationfol der is "c:\apache2\htd ocs"

I wrote host=localhost, user=root and password in config.inc.php.
php.ini

I removed the ; before "extension=php_ mysql.dll"

I removed the ; before "extension=php_ mbstring.dll"
At the row "extension_ dir" I wrote:

extension_dir=" c:\php\ext"
I copied libmysql.dll in c:\mysql\bin to:

c:\apache2\bin
I did restart apache and tested to surf to http://localhost/phpmyadmin and it worked!



Jul 1 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
4819
by: Mr Dygi | last post by:
Hi, PHP 4.3.4 installed manually from package *.zip and Apache 2. I have a problem with this simple code: <?php $link = mysql_connect("127.0.0.1","","") or die("Could not connect: " . mysql_error()); echo "Connected successfully"; mysql_close($link);
0
2408
by: Bill Hernandez | last post by:
Hi, I've been writing software on the mac since 1987, but am brand new at unix/php/mysql, and that's where I'm headed so I'm reading everything I can get my hands on, but like anything else there's going to be a learning curve, that having been said... I followed the install instructions at http://entropy.ch , and was able to get mySql & php installed on my G4 -> (OSX 10.2.6) last night. I downloaded Navicat and setup a password for...
0
9012
by: Ryan Stewart | last post by:
I'm running MySQL server on a WinXP box at home. I have a cable modem/router. I've set up port forwarding on port 3306 to the machine running MySQL. I can connect locally just fine, but when I try to connect from a remote location using: mysql -h xxx.xxx.xxx.xxx -P 3306 -u root -p mysql I get: ERROR 2003: Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (10061) When I try:
3
17808
by: Pugi! | last post by:
On a freshly installed Fedora C3 (incl. webserver apache php mysql) i get the following problem when connecting to mysql through a browser (phpMyAdmin): : #2002 Can't connect to local MySQL server through socket /var/lib/mysql/mysql.sock On the website of MySQL this error is mentioned but I found no solution. In /var/log/messages the following log occurs :
1
121535
by: jiing | last post by:
Now let me describe what I have done and my purpose: Originally, I want to user ports to install phpBB But I found that phpBB doesn't support mysql 5.x (but the ports installed mySQL 5.0.0 alpha) so I deinstall mysql5-server and mysql5-client And then I install mysql41-server and mysql41-client on FreeBSD 5.3 by ports but now , mysql is not workable
2
2745
by: xiuchuanli | last post by:
I install Fedora 4 with web server, after that I installed mysql 5.0.15. Now I can connect to mysql from command line and mysql-administrator and mysql-query-browser. But when I try to test to connect from php code, it told me that "can not connect to local mysql through /tmp/mysql.sock. /tmp/mysql.sock is my sock file to connect and permission is set good. when I add phpinfo() to my php code, it show me that mysql lib php uses is 4.1.X,...
0
1826
by: xiuchuanli | last post by:
I install Fedora 4 with web server, after that I installed mysql 5.0.15. Now I can connect to mysql from command line and mysql-administrator and mysql-query-browser. But when I try to test to connect from php code, it told me that "can not connect to local mysql through /tmp/mysql.sock. /tmp/mysql.sock is my sock file to connect and permission is set good. when I add phpinfo() to my php code, it show me that mysql lib php uses is 4.1.X,...
1
4510
by: linux | last post by:
Sorry if this is a really dumb question. I am trying to connect to our remote MySQL server (which is running just fine). I have a perl script which worked just fine on my other Fedora 4 box (all servers are Fedora 4 with latests updates). The one that worked fine it down and I cannot compare anything against it (it was a client also). My problem is, when I try to connect to the server I get:
2
22542
by: Martin | last post by:
Hi all. I have a fully functional page hosted on my PC that uses PHP and connects to MySQL on my PC to generate it's code. I now have some web hosting available which includes both PHP and MySQL support, however the webhost is still in the process of getting the MySQL support activated and functional. I therefore have uploaded my webpage to the host and edited the webpage
5
2634
by: scorpionbilli | last post by:
Hi, The local mysql server is running on my Macbook. I can access it through the console client: $ mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.0.45 MySQL Community Server (GPL)
0
8979
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8818
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9355
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8234
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6790
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6069
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3296
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.