473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

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>mysqladmin -u root creare mindb

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

I then tried to use -p and wrote this instead:
c:\mysql\bin>mysqladmin -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'@'localhost' (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=localhost, servername=localhost 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 "#LoadModule ssl_module modules/mod_ssl.so" I wrote:

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

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

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

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

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

Changed "doc_root" to:

c:\Apache2\htdocs
Created a tmp-folder in:

c:\apache2\ and wrote the path in session.save_path:

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 "Configuration Wizard" and did choose a password for
root.
PhpMyAdmin

Installationfolder is "c:\apache2\htdocs"

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 4534
Could you try next thing:

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

use mindb

GRANT ALL PRIVILEGES ON *.* TO 'ODBC'@'localhost' 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>mysqladmin -u root creare mindb

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

I then tried to use -p and wrote this instead:
c:\mysql\bin>mysqladmin -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'@'localhost' (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=localhost, servername=localhost 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 "#LoadModule ssl_module modules/mod_ssl.so" I wrote:

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

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

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

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

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

Changed "doc_root" to:

c:\Apache2\htdocs
Created a tmp-folder in:

c:\apache2\ and wrote the path in session.save_path:

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 "Configuration Wizard" and did choose a password for
root.
PhpMyAdmin

Installationfolder is "c:\apache2\htdocs"

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\MySQL Server 5.0\bin
mysql -h localhost -u root -p

use mindb

GRANT ALL PRIVILEGES ON *.* TO 'ODBC'@'localhost' 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>mysqladmin -u root creare mindb

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

I then tried to use -p and wrote this instead:
c:\mysql\bin>mysqladmin -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'@'localhost' (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=localhost, servername=localhost 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 "#LoadModule ssl_module modules/mod_ssl.so" I wrote:

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

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

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

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

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

Changed "doc_root" to:

c:\Apache2\htdocs
Created a tmp-folder in:

c:\apache2\ and wrote the path in session.save_path:

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 "Configuration Wizard" and did choose a password for
root.
PhpMyAdmin

Installationfolder is "c:\apache2\htdocs"

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>mysqladmin -u root creare mindb

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

I then tried to use -p and wrote this instead:
c:\mysql\bin>mysqladmin -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'@'localhost' (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=localhost, servername=localhost 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 "#LoadModule ssl_module modules/mod_ssl.so" I wrote:

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

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

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

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

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

Changed "doc_root" to:

c:\Apache2\htdocs
Created a tmp-folder in:

c:\apache2\ and wrote the path in session.save_path:

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 "Configuration Wizard" and did choose a password for
root.
PhpMyAdmin

Installationfolder is "c:\apache2\htdocs"

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*******@attglobal.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.databases.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\MySQL Server 5.0\bin
mysql -h localhost -u root -p

use mindb

GRANT ALL PRIVILEGES ON *.* TO 'ODBC'@'localhost' 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>mysqladmin -u root creare mindb

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

I then tried to use -p and wrote this instead:
c:\mysql\bin>mysqladmin -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'@'localhost' (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=localhost, servername=localhost 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 "#LoadModule ssl_module modules/mod_ssl.so" I wrote:

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

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

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

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

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

Changed "doc_root" to:

c:\Apache2\htdocs
Created a tmp-folder in:

c:\apache2\ and wrote the path in session.save_path:

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 "Configuration Wizard" and did choose a password for
root.
PhpMyAdmin

Installationfolder is "c:\apache2\htdocs"

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
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: " ....
0
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...
0
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...
3
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...
1
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...
2
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...
0
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...
1
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...
2
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...
5
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.