Not able to type mysql at command prompt
Posted by: st7james (---.dhcp.klmz.mi.charter.com)
Date: May 02, 2019 06:13PM

I'm getting Access denied for user 'ODBC'@'localhost' (using password: YES). The icon is green. I can log into everything fine. I can't connect to the server using PHP yet, but think possibly it's related to this. ???? when I open up services the only MySQL running is MySQL80. I've tried running mysqld, but this persistent error reports. My PHP is using localhost username password to connect but no go. I've removed all instances of offending path references from the environment variables, but there is an error showing at the bottom of the popup saying there is. Possibly an update/refresh type problem there. ???

Options: ReplyQuote
Re: Not able to type mysql at command prompt
Posted by: RiggsFolly (Moderator)
Date: May 02, 2019 06:17PM

Hi,

If you see MySQL80 as the service name then that is a MySQL instance that was not installed by WAMPServer.

Normally if you have installed a version of MySQL manually, then it will be set to Auto Start at BOOT time. So it will always be running and HOGGING port 3306, so WAMPSevrers MySQL (wampmysqld or wampmysqld64) will never get to start.


Backup any databases you may have created on the other MySQL and then uninstall it.

Then the version of MySQL installed with WAMPServer will be able to get a look at port 3306 smiling smiley

Oh and the reason you cannot login, is probably because you are using `root` as the MySQL user account. But the non-wampserver MySQL has a password set for root!

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.8 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.16>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 05/02/2019 06:20PM by RiggsFolly.

Options: ReplyQuote
Re: Not able to type mysql at command prompt
Posted by: st7james (---.dhcp.klmz.mi.charter.com)
Date: May 02, 2019 07:05PM

I've disabled all 'sql' and 'mysql' service except wamp. wampmysqld is started fine. the icon is green. I just can't type mysql at the command prompt. I had it in the path but removed it as instructed to do so by wamp. It is saying the command is not recognized. I can't connect to the server with PHP. And I'm wondering if it is related to this odd command prompt problem. I should be able to type the command at the prompt...right?

Options: ReplyQuote
Re: Not able to type mysql at command prompt
Posted by: st7james (---.dhcp.klmz.mi.charter.com)
Date: May 02, 2019 07:26PM

[02-May-2019 17:00:26 UTC] PHP Fatal error: Unsupported operand types in C:\wamp64\scripts\refreshMySQL.php on line 213

this error is showing up in the php error log.


{213}
$mysqlini += array('prompt' => 'default');

Options: ReplyQuote
Re: Not able to type mysql at command prompt
Posted by: st7james (---.dhcp.klmz.mi.charter.com)
Date: May 02, 2019 07:31PM

Here's the code which will not connect:

<? php
$db_host='localhost';
$db_username='lee';
$db_password='*******';
mysql_connect($db_host,
$db_username, $db_password)
or die("<p>Error connecting to database: " .
mysql_error() . "</p>"winking smiley;

echo "<p>Connected to MySQL!</p>";
?>

password is blanked out of course

Options: ReplyQuote
Re: Not able to type mysql at command prompt
Posted by: Otomatic (Moderator)
Date: May 02, 2019 08:09PM

Hi,

> $db_username='lee';

In Wampserver, after installation as well as in the new MySQL or MariaDB versions, the only existing user is "root" without a password.
It is therefore necessary that you declare the user "lee" with his password for the mySQL version you are using, before you can connect with this user.
This can be done via PhpMyAdmin or via the MySQL console.

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.9 32 bit - Apache 2.4.41 - PHP 7.3.8/7.2.21/7.1.31/7.0.33/5.6.40 - MySQL 5.7.27 - MariaDB 10.3.16
Wampserver 3.1.9 64 bit - Apache 2.4.41 - PHP 7.3.8/7.2.21/7.1.31/7.0.33/5.6.40 - MySQL 5.7.27/8.0.17 - MariaDB 10.3.16
PhPMyadmin 4.9.0.1 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Not able to type mysql at command prompt
Posted by: RiggsFolly (Moderator)
Date: May 02, 2019 08:54PM

Also the mysql API is so dead its started to smell.

If you are using PHP 7 or greater is does not exists any more.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.8 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.16>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Not able to type mysql at command prompt
Posted by: st7james (---.dhcp.klmz.mi.charter.com)
Date: May 03, 2019 02:34AM

>It is therefore necessary that you declare the user "lee" with his password for the mySQL version you are using

user lee has all privileges set. I have no trouble logging into mysql from the wamp interface mysql console. so I take it using command prompt to log in will not work. OK. Any idea why the PHP doesn't work then to log in? I did notice a 'smiley face in the code I posted which is actually a 'right parenthesis' in the code. I don't understand where the emote came from. But do you think it may be related to my inability to log on with PHP?

Options: ReplyQuote
Re: Not able to type mysql at command prompt
Posted by: Otomatic (Moderator)
Date: May 03, 2019 09:09AM

Hi,

> I have no trouble logging into mysql from the wamp interface mysql console.
Because the MySQL console uses the right API.

> mysql_connect($db_host,$db_username, $db_password)
The mysql API no longer exists since PHP 7.
You must use the mysqli API: mysqli_connect(...

See [www.php.net] procedural style.

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.9 32 bit - Apache 2.4.41 - PHP 7.3.8/7.2.21/7.1.31/7.0.33/5.6.40 - MySQL 5.7.27 - MariaDB 10.3.16
Wampserver 3.1.9 64 bit - Apache 2.4.41 - PHP 7.3.8/7.2.21/7.1.31/7.0.33/5.6.40 - MySQL 5.7.27/8.0.17 - MariaDB 10.3.16
PhPMyadmin 4.9.0.1 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Not able to type mysql at command prompt
Posted by: st7james (---.dhcp.klmz.mi.charter.com)
Date: May 03, 2019 05:43PM

thank you for all your help. The PHP link helped immensely. I am using a 2012 copyrighted book to learn PHP /MySQL. but the PHP site will help me work around dated code style. Thank you again.

Options: ReplyQuote
Re: Not able to type mysql at command prompt
Posted by: Otomatic (Moderator)
Date: May 03, 2019 06:07PM

Hi,

> The PHP link helped immensely

In any case where there is a problem, the first thing to do is to read the official documentation.
It is not for nothing that in our signatures at RiggsFolly and myself there are the urls of the Apache, PHP, MySQL and MariaDB documentation. These urls are also in the Documentation items of the Wampserver menus.

RTFM must be your motto before going to see on the Internet which is full of bullshit.

Of course, sometimes it is difficult to find where the information you are looking for is, but you have to persevere.

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.9 32 bit - Apache 2.4.41 - PHP 7.3.8/7.2.21/7.1.31/7.0.33/5.6.40 - MySQL 5.7.27 - MariaDB 10.3.16
Wampserver 3.1.9 64 bit - Apache 2.4.41 - PHP 7.3.8/7.2.21/7.1.31/7.0.33/5.6.40 - MySQL 5.7.27/8.0.17 - MariaDB 10.3.16
PhPMyadmin 4.9.0.1 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Not able to type mysql at command prompt
Posted by: st7james (---.dhcp.klmz.mi.charter.com)
Date: May 06, 2019 10:14PM

is it necessary to mariadb running in order to use mysql? the wamp icon will turn orange i believe, but will everything else work as intended? i don't believe at this point i have any use for mariadb.

Options: ReplyQuote
Re: Not able to type mysql at command prompt
Posted by: RiggsFolly (Moderator)
Date: May 07, 2019 09:46AM

You can turn mariaDB off if you have no need of it.

Again using the WAMPServer menus

- (RIGHT CLICK) wampmanager -> Wamp Settings -> allow MariaDB

If this has a green tick beside it, then mariaDB is turned on, click the line "allow MariaDB" and it will turn OFF the green tick and remove the mariaDB Service.

This will take a few seconds and then wampserver will restart without mariaDB and the System Tray Icon SHOULD GO GREEN

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.8 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.16>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 05/07/2019 09:56AM by RiggsFolly.

Options: ReplyQuote


Sorry, only registered users may post in this forum.