473,226 Members | 1,655 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,226 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 4513
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: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.