LeonLatex Posted June 5, 2022 Share Posted June 5, 2022 I can, no matter what create a new database, new user, or set privileges by using the command line, terminal window, from Laragon, or other GUI When I check the Microsoft Management Console, I can't find MySQL listed, but MySQL is started and running. Am I just tired or what? Quote Link to comment https://forums.phpfreaks.com/topic/314893-cant-create-database-and-more-problems-with-laragon-and-mysql/ Share on other sites More sharing options...
benanamen Posted June 5, 2022 Share Posted June 5, 2022 Did you try clicking the "Database" button on the Laragon GUI? That opens HeidiSQL which you can use to manage databases. Quote Link to comment https://forums.phpfreaks.com/topic/314893-cant-create-database-and-more-problems-with-laragon-and-mysql/#findComment-1597001 Share on other sites More sharing options...
LeonLatex Posted June 5, 2022 Author Share Posted June 5, 2022 1 hour ago, benanamen said: Did you try clicking the "Database" button on the Laragon GUI? That opens HeidiSQL which you can use to manage databases. Quote Link to comment https://forums.phpfreaks.com/topic/314893-cant-create-database-and-more-problems-with-laragon-and-mysql/#findComment-1597002 Share on other sites More sharing options...
LeonLatex Posted June 5, 2022 Author Share Posted June 5, 2022 (edited) Yes i have tried that and most of other things. With and without password to. Edited June 5, 2022 by LeonLatex Quote Link to comment https://forums.phpfreaks.com/topic/314893-cant-create-database-and-more-problems-with-laragon-and-mysql/#findComment-1597003 Share on other sites More sharing options...
LeonLatex Posted June 5, 2022 Author Share Posted June 5, 2022 This happens when I try to create a new password Menu>MySQL>Change Password. Quote Link to comment https://forums.phpfreaks.com/topic/314893-cant-create-database-and-more-problems-with-laragon-and-mysql/#findComment-1597010 Share on other sites More sharing options...
gizmola Posted June 5, 2022 Share Posted June 5, 2022 MySQL uses a scheme where every user has a name & host component. So for example: root@localhost. It is possible to have wildcards for the hostname component, but typically accounts will start out being constrained to localhost. It's important to understand how this works, because permissions are then granted to a specific user@host combination, and if later someone adds a wildcard account for the combination (for example -- 'user@%' that user will not inherit/adopt the permissions of the existing user@localhost account. There will be a "root" level account for mysql that has all rights. By default, this is usually root@localhost. This user can create new users, change passwords, create databases and grant permissions for new or existing users to that database. Typically what is done for security purposes is: root level account creates a database root level account creates/GRANT access to the database for that user. Application will use this user to work with the database. Some of the specifics of the syntax of the SQL used to create a new user or assign it a password have changed over time between mysql and mariadb versions. Tools that were dependent on the syntax or specific password scheme may no longer work properly given a specific version. What your screenshot shows is that laragon is logging you in a specific configured user, that was created and given access to a database. That user does not have access to create a new database. This is a typical setup. You need to login to mysql as the "root" user that laragon setup initially. I think it is probably still 'root@localhost'. Apparently by default the root password was unset. This SO thread talks about this, although it is a 4 year old thread: https://stackoverflow.com/questions/50214540/laragon-never-use-mysql-password Quote Link to comment https://forums.phpfreaks.com/topic/314893-cant-create-database-and-more-problems-with-laragon-and-mysql/#findComment-1597014 Share on other sites More sharing options...
benanamen Posted June 5, 2022 Share Posted June 5, 2022 (edited) You are trying to connect as a user other than the default root account. (122387_chapterofhate@localhost) The account you are connecting with does not have the permissions needed to do what ever it is you are trying to do. Laragon is a local development wamp. There is really no reason you need to be creating and using any other MySQL users except maybe for learning about permissions. Edited June 5, 2022 by benanamen Quote Link to comment https://forums.phpfreaks.com/topic/314893-cant-create-database-and-more-problems-with-laragon-and-mysql/#findComment-1597015 Share on other sites More sharing options...
LeonLatex Posted June 5, 2022 Author Share Posted June 5, 2022 (edited) Edit for some reason. Edited June 5, 2022 by LeonLatex Quote Link to comment https://forums.phpfreaks.com/topic/314893-cant-create-database-and-more-problems-with-laragon-and-mysql/#findComment-1597017 Share on other sites More sharing options...
LeonLatex Posted June 5, 2022 Author Share Posted June 5, 2022 4 hours ago, gizmola said: MySQL uses a scheme where every user has a name & host component. So for example: root@localhost. It is possible to have wildcards for the hostname component, but typically accounts will start out being constrained to localhost. It's important to understand how this works, because permissions are then granted to a specific user@host combination, and if later someone adds a wildcard account for the combination (for example -- 'user@%' that user will not inherit/adopt the permissions of the existing user@localhost account. There will be a "root" level account for mysql that has all rights. By default, this is usually root@localhost. This user can create new users, change passwords, create databases and grant permissions for new or existing users to that database. Typically what is done for security purposes is: root level account creates a database root level account creates/GRANT access to the database for that user. Application will use this user to work with the database. Some of the specifics of the syntax of the SQL used to create a new user or assign it a password have changed over time between mysql and mariadb versions. Tools that were dependent on the syntax or specific password scheme may no longer work properly given a specific version. What your screenshot shows is that laragon is logging you in a specific configured user, that was created and given access to a database. That user does not have access to create a new database. This is a typical setup. You need to login to mysql as the "root" user that laragon setup initially. I think it is probably still 'root@localhost'. Apparently by default the root password was unset. This SO thread talks about this, although it is a 4 year old thread: https://stackoverflow.com/questions/50214540/laragon-never-use-mysql-password 4 hours ago, benanamen said: You are trying to connect as a user other than the default root account. (122387_chapterofhate@localhost) The account you are connecting with does not have the permissions needed to do what ever it is you are trying to do. Laragon is a local development wamp. There is really no reason you need to be creating and using any other MySQL users except maybe for learning about permissions. For once, Gizmola managed to put me out, but when I got to read it a few times again and read what was behind the link, I eventually understood it approx. although it did not solve the problem. Whether I'm logged in as root or "122387_chapterofhate @ localhost". As I told you, I had trouble entering the password on the root account, but suddenly it worked. So now there is a password on this account. This is local, so there is no danger in terms of security without a password on the root account, but it's just that I build this so it should be the same as when it is uploaded to the webserver-hotel-room. It seems like I'm locked out of administrative privileges, but because I suddenly was able to create a root password, I'm slipping through. I do not understand in hell what is happening, and now I have struggled with this for over a day, soon two. So bananamen, I wonder if I have to re-install MySQL one more time. Maybe unnecessary, but I have not a clue after so many hours.... Quote Link to comment https://forums.phpfreaks.com/topic/314893-cant-create-database-and-more-problems-with-laragon-and-mysql/#findComment-1597018 Share on other sites More sharing options...
benanamen Posted June 5, 2022 Share Posted June 5, 2022 You dont need to re-install mysql. Here is what you do... For Laragon with MySQL 8 with no password Login to the laragon mysql from the console (Click the Terminal button on the Laragon GUI interface) mysql -u root -p Just hit enter when it prompts for password Then to set the password, in this case, to "secret" ALTER USER 'root'@'localhost' IDENTIFIED BY 'secret'; To go back to no password with MySQL8 ALTER USER 'root'@'localhost' IDENTIFIED BY ''; Quote Link to comment https://forums.phpfreaks.com/topic/314893-cant-create-database-and-more-problems-with-laragon-and-mysql/#findComment-1597020 Share on other sites More sharing options...
LeonLatex Posted June 5, 2022 Author Share Posted June 5, 2022 No way. There is as I told you. I can't log in. None of the three above is functional. Maybe you could connect to me once more and re-install it? Quote Link to comment https://forums.phpfreaks.com/topic/314893-cant-create-database-and-more-problems-with-laragon-and-mysql/#findComment-1597021 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.