I've been using MAMP out of convenience but have run into major problems after mistakenly changing root permissions. I have not been able to resolve these problems and have opted for a fresh install of MAMP and moving over the db folders, which I read was possible. In doing so, I have a number of DBs which have tables that are MIA.
SHOW GRANTS FOR 'root'#'localhost'
response:
GRANT ALL PRIVILEGES ON *.* TO 'root'#'localhost' IDENTIFIED BY PASSWORD '*81F5E21E35407D884A6CD4A731AEBFB6AF209E1B' WITH GRANT OPTION
GRANT PROXY ON ''#'' TO 'root'#'localhost' WITH GRANT OPTION
I can see the all the tables in the db folder but not all are not showing up in phpmyadmin.
I believe phpmyadmin connects as a socket "Server: Localhost via UNIX socket"
When I login into the console as root/localhost I can see all the tables.
Loggin into the console as root/127.0.0.1 I cannot see the DB at all.
I'm really stuck here and have pretty much lost a day of work because of this.
Update:
When I run mysql_update command I get the following response.
→ /Applications/MAMP/Library/bin/mysql_upgrade -p
Enter password:
Looking for 'mysql' as: /Applications/MAMP/Library/bin/mysql
Looking for 'mysqlcheck' as: /Applications/MAMP/Library/bin/mysqlcheck
Running 'mysqlcheck with default connection arguments
Running 'mysqlcheck with default connection arguments
ipbnew.ipb_admin_login_logs
Error : Table 'ipbnew.ipb_admin_login_logs' doesn't exist
status : Operation failed
ipbnew.ipb_admin_logs
Error : Table 'ipbnew.ipb_admin_logs' doesn't exist
status : Operation failed
I've posted a full explanation of the solution to my problem in a separate SO topic.
MAMP mysql broken root user
Related
I'm using MySQL on windows (I wish I was using Mac, but due to some issues I'm using Bootcamp), and I've encountered a problem I think I've encountered before: the error that is written in the title. I think I might have solved this once before by erasing MySQL through the control panel and by erasing everything in the hidden folder, ProgramData, and MySQL from ProgramFiles, then reinstalling it. It is such a hassle and consumes a lot of time. It definitely isn't something I can do repeatedly to solve this problem if I get an error like this again and again.
The problem:
I simply ran this code on CMD after "cd"ing to the bin folder that contains mysql: mysql -u root -p PASSWORD but I get the error written in the title. Thus I can't login to mysql and run any lines to edit the database.
There are so many other topics like this in stackoverflow:
MySQL Error: : 'Access denied for user 'root'#'localhost'
Access Denied for User 'root'#'localhost' (using password: YES) - No Privileges?
https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html
I tried implementing the solutions from the three links above. Many other advices advise to use the "sudo" command, which is not a windows command.
This is the line I get from implementing the solution given to me by dev.mysql.com (#3):
This is the line of code I ran in CMD:
mysqld --init-file=C:\\mysql-init.txt --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console
This is the code I ran to implement the solution in link #2:
mysqld --skip-grant-tables --skip-networking --console
and the code I get back:
Things to note:
Each time, I get this line of code back from the console:
[Warning]...[Server] CA certificate ca.pem is self signed.
In the first picture, this is the "ERROR" I get from the console: [ERROR]...[Server] unknown variable 'defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini'
In the second picture, this is the "ERROR" I get from the console: [ERROR] TCP/IP --shared memory, or --named-pipe should be configured on NT OS
This is the line of code I would put in in mysql-init.txt: ALTER USER 'root'#'localhost' IDENTIFIED BY 'PASSWORDHERE';
or this: INSERT INTO mysql.user (Host, User, Password) VALUES ('%', 'root', password('YOURPASSWORD'));
GRANT ALL ON *.* TO 'root'#'%' WITH GRANT OPTION;
I installed MySQL through the installation wizard.
Q. How did I encounter this error?:
A. I was experimenting on a project for a back-end Spring Boot project that uses JPA and JDBC combined. I got errors telling me that no datasource could be configured.
Q.How did my root password get reset?
A.I think they got reset because of JPA's datasource autoconfiguration. I didn't touch any of mysql's settings myself. Something I did on Spring Boot and its automatic configuration to localhost must have reset the password.
I will say that uninstall your MySQL and again install it with a new instance but not like just uninstall it from the control panel that's why you are facing the same error every time. I already answered here in detail that how to remove properly so no error will come by creating a new instance.
For anyone encountering this issue after they initialized their mysql server with following command:
mysqld --initialize
Look out for the last output of the process, it should say something like this:
[Note] [MY-010454] [Server] A temporary password is generated for root#localhost: password12345
there is your temporary password to log in.
I'm trying to connect to a mariadb server remotelly using terminal, but I get a little issue about that.
Preconditions
I have connection to my remote server, and I can enter inside maria db using the next command
mysql -u root -p**** and I enter without problems.
Also I have commented this line of my.conf from the #bind-address = 127.0.0.1.
When I'm trying to do this from my computer mysql -u root -h mariadb.testing.des -p**** I get the following error in console
ERROR 1045 (28000): Access denied for user 'root'#'mariadb.testing.des' (using password: YES)
Why am I getting two different results using the same user? What am I doing wrong?
Thanks for the help,
Jaster.
It's not enough to ensure your server is reachable from remote. You also have to create a user which has privileges for the remote access to your desired schema. I strongly recommend not to create a remote root user with access to all. Best practice is to create a remote user for every single scheme.
In example:
CREATE USER 'jeffrey'#'my.remote.host' IDENTIFIED BY 'mypass';
GRANT ALL ON jeffreys_db.* TO 'jeffrey'#'my.remote.host';
See also:
https://dev.mysql.com/doc/refman/5.7/en/create-user.html
https://dev.mysql.com/doc/refman/5.7/en/grant.html
I wanted to setup my owncloud installation on my raspberry pi 2. So, I created an mysql database and user.
CREATE DATABASE owncloud;
CREATE USER 'owncloud'#'localhost' IDENTIFIED BY 'Password';
GRANT ALL PRIVILEGES ON owncloud. * TO 'owncloud'#'localhost';
FLUSH PRIVILEGES;
After I type all nessesairy parameters into the webinterface of the owncloud-setup, I recevied:
Error while trying to create admin user: Failed to connect the database: An exeption occured in driver: SQLSTATE[HY000][1045] Access denied for user 'owncloud'#'localhost' (using password:YES)
Sadly, my resent sreach on similar topics didn't result in any functional hint on this problem. So, I would be happy about further suggestions.
Look at this: https://doc.owncloud.org/server/9.0/admin_manual/installation/installation_wizard.html#database-choice
In Terminal: mysql_upgrade --force -u root -p
Use administrative MySQL »root«-user and password with the Installation Wizard
Check that the Database not exist which you create with the Installation Wizard
If nothing helps, start with sqlite, then migrate to mysql like this: https://doc.owncloud.org/server/9.0/admin_manual/configuration_database/db_conversion.html
Just replace localhost for 127.0.0.1 in Owncloud's setup form for MySQL as mentioned in comments above by Askaga
For some reason, explicitly re-access the database from the terminal solves the problem for me. Just give mysql an empty line with
mysql -u root -e ";"
This should be an individual command after you created database and database user.
Sure, you should always check whether
There are users with an empty username. Remove them.
Remove "test" database.
Grant appropriate permission to your database user.
Last but not least FLUSH PRIVILEGES;.
Search other posts for instructions. I'm just providing a possible solution if you come across a situation where none of the above works.
Here's a good example to properly setup mysql after installation. FYI.
Mask the DB password in the installation screen (the password should not be visible, only dots) and retry.
Ubuntu 18.04.1, Owncloud 10.
Check the contents of config.php in my case located at /var/www/owncloud/config/.
Specialy items dbuser and dbpasswrd.
Read config.sample.php in the same directory for info.
There is much information about this error but seems nothing works.
So I try to access to xampp mysql-server using the user root from local network.
mysql -uroot -p -h 192.168.100.48 --port=3306 (connecting from other local computer to xampp server)
But even I put right password (which I use for root) it not work. It works only if I log in using same computer where the server is running. I can use other user which I have specified but not root user. Why?
So how to fix this problem and getting it working?
Does the root user have the correct permissions?
Check the first duplicate link below for full answer - credit to Michael Berkowski:
GRANT ALL PRIVILEGES ON *.* TO 'root'#'192.168.1.%'
IDENTIFIED BY 'some_characters'
WITH GRANT OPTION;
FLUSH PRIVILEGES;
Have you tried search SO first? There are quite a few questions like this.
Possible duplicates:
How to grant remote access permissions to mysql server for user?
Remote MySql connection from other server
I installed wamp 2.1 on windows 7. However when i open phpMyAdmin, I get the error, Mysql 'No Provileges'. I uninstalled wamp and reinstalled it a few times, but it doesn't help. Does anyone know how to solve this issue?
Also, when i tried creating a database from mysql console, i am getting the following error:
ERROR 1044 <42000>: Access denied for user ''#'localhost' to database 'a_db_name'
Thank God and to all helped.
Its simple.
Must! click logout icon in phpadmin page
In login page, type:
username:root password: (blank)
surprise. now you can happily create your database.
Are you logging into MySQL as root? You have to explicitly grant privileges to your "regular" MySQL user account while logged in as MySQL root.
First set up a root account for your MySQL database.
In the terminal type:
mysqladmin -u root password 'password'
To log into MySQL, use this:
mysql -u root -p
Edit:
To set the privileges manually start the server with the skip-grant-tables option, open mysql client and manually update the mysql.user table and/or the mysql.db tables. This can be a tedious task though so if what you need is an account with all privs I would do the following.
Start the server with the skip-grant-tables option
Start mysql client (without a username/password)
Issue the command
flush privileges;
which forces the grant tables to be loaded.
Create a new account with the GRANT command something like this (but replacing username and password with whatever you want to use.
GRANT ALL on *.* to 'username'#'localhost' identified by 'password';
Restart the server in normal mode (without skip-grant-tables) and log in with your newly created account.
Refer this MySQL docs.
Take a look at my topic regarding this issue, which takes some of the above.
MAMP mysql broken root user
You need to shutdown your mysql install and restart it from the command line properly like is indicated above. In my topic I have full clear instructions on how to do so. My instructions are for MAMP but you should be able to adapt it for your install.
Simple solution. Just find the icon right to "home" in PhpMyAdmin and click to logout. Then login using username "root" and password ""(blank). This will work accordingly.
username ought to be root and keep the password null(keep the password field blank)
right click on the wamp icon and goto mysql console.
Login with password if you have set any.By default the password is blank and username is 'root'
Once you are in mysql prompt execute
FLUSH PRIVILEGES;
now quit the command prompt and you are good to go.
in step 1 .inter your databasevery important.
in step 2 .select your database via all tables .
in step 3. backup type=replace & export.
in step 4 import database in my sql.
attention please:in import your database...
all table must view & selected in step 4.