Connecting Tech Pros Worldwide Help | Site Map

Connect to mysql?

  #1  
Old June 29th, 2006, 06:55 PM
news.telia.net
Guest
 
Posts: n/a
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!






  #2  
Old June 29th, 2006, 07:15 PM
Garbage Monster
Guest
 
Posts: n/a

re: Connect to mysql?


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:[color=blue]
> 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!
>
>
>
>
>
>[/color]
  #3  
Old June 30th, 2006, 12:55 AM
news.telia.net
Guest
 
Posts: n/a

re: Connect to mysql?


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




[color=blue]
> 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'[/color]
WITH GRANT OPTION;[color=blue]
>
>
> news.telia.net wrote:[color=green]
> > 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[/color][/color]
manual[color=blue][color=green]
> > 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[/color][/color]
earlier[color=blue][color=green]
> > versions "my.ini" looks very different and user and password were[/color][/color]
written[color=blue][color=green]
> > there, but not anymore. Why, or is it me who have done something wrong?[/color][/color]
When[color=blue][color=green]
> > 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[/color][/color]
and[color=blue][color=green]
> > it worked!
> >
> >
> >
> >
> >
> >[/color][/color]


  #4  
Old June 30th, 2006, 03:35 AM
Jerry Stuckle
Guest
 
Posts: n/a

re: Connect to mysql?


news.telia.net wrote:[color=blue]
> 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!
>
>
>
>
>
>[/color]

Maybe ask in a MySQL newsgroup, such as comp.databases.mysql?


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
  #5  
Old July 1st, 2006, 03:55 AM
Garbage Monster
Guest
 
Posts: n/a

re: Connect to mysql?


> I tried it and it worked. What does -h mean?
mysql --help
[color=blue]
>
> 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?[/color]
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
  #6  
Old July 1st, 2006, 02:25 PM
Garbage Monster
Guest
 
Posts: n/a

re: Connect to mysql?


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:[color=blue]
> 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
>
>
>
>
>[color=green]
>> 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'[/color]
> WITH GRANT OPTION;[color=green]
>>
>> news.telia.net wrote:[color=darkred]
>>> 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[/color][/color]
> manual[color=green][color=darkred]
>>> 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[/color][/color]
> earlier[color=green][color=darkred]
>>> versions "my.ini" looks very different and user and password were[/color][/color]
> written[color=green][color=darkred]
>>> there, but not anymore. Why, or is it me who have done something wrong?[/color][/color]
> When[color=green][color=darkred]
>>> 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[/color][/color]
> and[color=green][color=darkred]
>>> it worked!
>>>
>>>
>>>
>>>
>>>
>>>[/color][/color]
>
>[/color]
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
I have problem with connect to MySQL server please help me!! suma answers 5 October 17th, 2007 10:45 AM
Can't connect to mysql server dmcquay@gmail.com answers 3 May 10th, 2006 06:35 PM
Cannot connect to MySQL using VB.NET 1.1 zMisc answers 2 February 23rd, 2006 05:55 AM
cant connect to mysql server through socket D. K. answers 0 July 19th, 2005 11:51 PM
Connect to MySQL Mr Dygi answers 20 July 17th, 2005 04:00 AM