Cannot connect - invalid settings - mysql

I'm using windows 10 & am having all kinds of trouble with Xampp/MySql/PhpMyAdmin, problems which I did not get on Windows 7.
So basically I made a Laravel website at work where I still use windows 7, so the password for the MySQL database works fine there.
However when I try to login on my website at home (windows 10) I get the 'using password NO' error... So to rectify this error I used the Xampp shell and executed this command: mysqladmin --user=root password "newpassword" which then allowed me to use any database dependent functions on my website that previously did not work, but now when I try to get onto localhost/phpmyadmin I am getting the error 'Cannot connect - invalid settings'.
So in summary it's either I can
A. get on phpmyadmin fine but none of the database dependent features of my Laravel site work.
B. The database features all work but I can't access phpmyadmin anymore.
Can anyone advise on how I can get both things to work?!

So you're using two machines, correct?
Then it will be your configuration that's different from the other.
Reinstall it on the Windows 10 machine and replicate what you've done on the other machine (copy the xampp files over like the php.ini and any other configuration file).

Related

Can't select database error in WordPress localhost on WAMP Server

I’m following this Lynda.com tutorial (WordPress – Building Themes from Scratch Using Underscores (2017)) and haven’t gotten very far. I’ve installed a blank WordPress install on localhost using WAMP Server and I downloaded and installed the underscores theme. But for some reason when I am trying to launch the website I am getting this error:
Can’t select database
We were able to connect to the database server (which means your username and password is okay) but not able to select the lynda_under17_040518 database.
Are you sure it exists?
Does the user root have permission to use the lynda_under17_040518 database?
On some systems the name of your database is prefixed with your username, so it would be like username_lynda_under17_040518. Could that be the problem?
If you don’t know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums.
Here is what i know
The database exists and I can run SQL commands on it in phpMyAdmin.
My user is root
Host is localhost
Database is lynda_under17_040518
root has all privileges to database (as verified in phpMyAdmin)
Other local websites on the same WAMPServer work just fine
This Stack Overflow post says to put define( 'WP_DEBUG_LOG', true ); in wp-config.php which I’ve done. It also says:
“the debug.log file will be in wp-content.”
I don't see any debug log even though I’ve restarted all services in WAMP and refreshed the browser.
Other Links I Consulted
I reviewed the info on these pages, but they didn't really help for my situation.
can't select database wordpress error
Can't select database - Wordpress
https://acloud.guru/forums/aws-certified-solutions-architect-associate/discussion/-KP4_87InltfL9P6rf-J/cant-select-database-wordpress-error
https://chartio.com/resources/tutorials/how-to-grant-all-privileges-on-a-database-in-mysql/
https://serverfault.com/questions/263868/how-to-know-all-the-users-that-can-access-a-database-mysql/263936
Where is my debug log and how can i get my local website running?
Even though SQL and its ilk will allow database names that are very long, a lot of applications (such as cPanel) will only recognize database names that are 16 characters or less. I suspect that your database name (lynda_under17_040518) is simply too long for WAMP and/or WordPress to recognize and will work correctly if the database name is shortened.
In my case, I was using an alternate port (something other than 3306), so I had to follow these instructions:
https://codex.wordpress.org/sk:Editing_wp-config.php#MySQL_Alternate_Port

MySQL & NetBeans Integration issue

I am trying to get MySQL and NetBeans to work together but I am getting a very weird behavior. When I installed MySQL I gave it a password and noticed it had a database called "test". I created a table in it and ran successful queries against it.
Then I rebooted my Windows 7 machine, opened up NetBeans and tried to connect to the database using the stored password. Connection failed. However connecting with a blank password succeeds, but the "test" database is now gone!!
I had a previous version of MySQL, but uninstalled it and removed all folders I could find with mysql in it.
I installed NetBeans EE from scratch.
Installed MySQL server only and gave root a non-blank password.
Connected to it using pwd from above and used NetBeans tools to add table to "test" database (which was there by default). Note this was done during the same computer log-in session.
Did nothing else but rebooted the machine and tried to connect to MySQL from NetBeans and got password error. Connecting with blank password works, but "test" db (along with my table) is now gone.
I suspect the "test" db may have to do with temporary files/setup, but I am not sure and I really don't understand the password issue...
Any help greatly appreciated.
Try another program to test the connection to the database. (to isolate the problem MySQL/NB)

Cannot access mysql by command line on Zend server on Windows 7

I recently installed the latest Zend Server CE 5.6.0 SP4 on Windows 7 complete with php and mysql.
At first the Zend Server wouldn't work as I think there was some conflict with ports with my Zonealarm firewall. I deactivated the firewall, rebooted tried again and it worked so then reactivated the firewall. Not sure if the firewall has now found an alternative port. I don't really know much about those things. I think the ports it's on are 80 and 10061 but not too sure.
Anyway, I'm working through a PHP/Mysql book where it shows how to connect to the mysql database using the command line without a password. The first suggestion was:
"C:\Program Files (x86)\Zend\MySQL51\bin" -u root
That didn't work so I manually navigated to the MySQL51\bin folder then typed mysql.exe -u root. It then gave an error Error 2003 (HY000): Can't connect to MySQL on 'localhost' 10061
I tried turning the firewall off and trying again but still no luck.
Any ideas or suggestions would be appreciated.
Thanks for any help
Gary
Although this is an old post, it was one of the top hits searching for this problem. I found a solution that works on current MySql55 installation under ZEND. In the Zend installation folder (on Windows, hopefully same on others), Zend\MySql55\bin there's a file "MySQLInstanceConfig.exe".
If you run that, it let's you force a change to the password, and then (for me) the command line worked.

Jasperserver installation unable to access database

I am trying to install jasperserver(war) in a CentOS linux machine. It throws up error saying,
Message: [Access denied for user 'jasperdb'#'xx.xx.xx.xx' to database 'mysql']
However, when I access mysql via command prompt it works fine. I am able to access via the user jasperdb from same machine where I am trying to install jasperserver.
It is also weird why jasperserver tries to access the database with name 'mysql'? Any solutions?
The mysql database within mysql is the one where user info is stored. That is why it is trying to access the mysql database. I am assuming you have 'jasperdb'#'localhost' in your mysql.user table. Try making sure that localhost and any other computer names are in your /etc/hosts filled in for 127.0.0.1.
If you are not using the ".war file" installer, I recommend using that. It's a lot easier to troubleshoot than the installer that bundles in Tomcat and PostgreSQL.
If you are using that, then you should find the credentials that you have set in default_master.properties. That includes both the user name and the database name. Run ant clean-config to make sure you aren't picking up any old settings.

MySQL Workbench: "Can't connect to MySQL server on 127.0.0.1' (10061)" error

I apologise.. I know this question has been asked many times before, but I've tried lots of suggestions, and simply can't find a solution.
The problem: I have a MySQL database running on a hosted server.
I have to use SSH to connect to it, and I have the relevant Public and Private Key files.
I specifically want to use the PC version of MySQL Workbench, to access this database, for running queries, checking data, etc.
If I run Sequel Pro on a Mac, it connects fine, and I can browse and query the database. No problems.
If I run the trial version of SQLyog on a PC, it also connects fine. No problems.
But if I try to connect use MySQL's own "MySQL Workbench" application, using exactly the same settings and SSH Private Key file, it refuses to connect, throwing the well-known error:
Can't connect to MySQL server on 127.0.0.1' (10061)
I find it frustrating, as, in SQL Workbench, I specified the "MySQL Hostname" to use, db01.mysql.vm.MyHostingServer.net, but Workbench seems to ignore it, and demand to connect to 127.0.0.1 instead.
(I have read that Workbench says it needs the Public key file, but actually means the Private key file... and I have tried with both. I've also tried with MySQL Workbench on a Mac, but that crashed all over the place, simply when I was typing in server names and passwords.. it was a mess !!)
The hosting service I've gone with gives me limited permissions for changing MySQL settings, and given that Sequel Pro and SQLyog can connect successfully, I don't want to start messing about and changing things randomly.
Any ideas...?
Maybe you are not allowed to start the service "MySQL 55". Set the login information of Service "MySQL 55" as local!
To see the list of aviable services in Windows 7:
Open a run box
Type services.msc and press return.
Find the service MySQL55
A right click of the MySQL55 Local Service shows Properties -> Log On
Even I had same problem, The reason was mysql service was not getting configured properly, when I installed it through 'MySQL installer'. Also it was not starting, when I tried to start the service manually.
So in my case it seemed be a Bug with the 'MySQL Installer', as editing the install path to a different one when the 'Developer default' was selected, the problem occurs.
Solution (Not exactly a solution):
Uninstalled the MySQL all products (completely)
Reinstalled, this time also I have selected 'Developer default', but didn't make any changes to the path or any thing. So the path was just 'C:\Program Files\MySQL' (the default one)
And just clicked Next Next...
Done, this time MySql was running fine.
After making above improvement such as checking if mysql service is running or not, you just need to give a small password while creating connection, it is ' ' or 1 time press on space-bar in case of GUI or workbench. After which you just need to validate your machine with server (validated HOST). For that purpose click on 'New Server Instance' and it will configure server/HOST on your behalf itself.
I have done this successfully just a few couple of minutes ago. My workbench software is able to show all pre-installed databases etc now.
hope it will work for you as well.
Thanks!!!
I was having same issue, way i have resolved is:
opened the MySQL installer. i was having a Reconfigure link on MYSQL Server row.
Clicked on it, it does reinstalled MySQL Server.
after that opened MySQL Workbench, and it was working fine.
Try placing the host name (db01.mysql.vm.MyHostingServer.net) in your windows host (C:\windows\system32\drivers\etc\host) file along with it's IP address and port number and see if that helps.
If you have installed WAMP on your machine, please make sure that it is running. Do not EXIT the WAMP from tray menu since it will stop the MySQL Server.
To connect to a new server, you click on home + add new connection. Put IP or webserver URL in new connection.
Just try to run the following command manually:
C:\wamp\bin\mysql\mysql5.6.17\bin\mysqld.exe --console
It worked for me :)
Ran into the exact same problem as OP and found that leaving the "MySQL Server Port" empty in the MySQL Workbench connection solves the issue.
I have tried all the method.
I will suggest you to reinstall it.