I have a big problem. When i enter into my server as root and type:
mysql -h localhost -P 3306 -u test_user -p
Note the user test_user doesn´t exist and i can even enter in the MariaDB without a password too.
What i can do to config the security in mariadb that not any user has access?
You need to delete user with empty name, like described in
http://dev.mysql.com/doc/refman/5.5/en/default-privileges.html, under "Removing anonymous accounts" section
Related
I recently tried to login into my MariaDB database via shell and got this error even though I'm 100% sure the password is correct:
mysql -u root -p
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
I'm running a node.js server that connects to the same database with the same password with no problems...
You don't have privileges to connect to the root mysql user. Simply use sudo:
sudo mysql -u root -p
Enter password that you use on your machine, after that enter password to the root mysql user.
I have server with multiple domains. And certbot works fine for all of them, excepts one.
Let's use "blog.domain.staging.com" as example for this question.
certbot certonly -t -n --dry-run --agree-tos --renew-by-default --email "${LE_EMAIL}" --webroot -w /usr/share/nginx/html -d blog.domain.staging.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for blog.domain.staging.com
Using the webroot path /usr/share/nginx/html for all unmatched domains.
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. blog.domain.staging.com (http-01): urn:ietf:params:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching https://blog.domain.staging.com.com/.well-known/acme-challenge/YWnMAB2mDZFl4-tEO1BCrKc3vP6yeAL2JVZP-A-BRV4: Error getting validation data
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: blog.domain.staging.com
Type: connection
Detail: Fetching
https://blog.domain.staging.com.com/.well-known/acme-challenge/YWnMAB2mDZFl4-tEO1BCrKc3vP6yeAL2JVZP-A-BRV4:
Error getting validation data
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address. Additionally, please check that
your computer has a publicly routable IP address and that no
firewalls are preventing the server from communicating with the
client. If you're using the webroot plugin, you should also verify
that you are serving files from the webroot path you provided.
You can see that hostname has additional ".com" and I don't know why and how to fix that.
There was a typo in the nginx config. Redirect link from http to https was with additional ".com". That was the problem.
I have this problem in my centos 7 and my database mariadb:
Access denied for user 'root'#'localhost' (using password: No)
when i try to run this program :
systemctl start slurmdbd
I already tried to use this solution but it doesn't work for me:
Access denied for user 'root'#'localhost' (using password: Yes) after password reset LINUX
mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
I also tried to reconfigure mariadb with mysql_secure_installation and create 'root' user with 'root' password.
But it's not working. Is there another solution?
I have installed Symfony project under MAMP htdocs project folder, which works perfect. I them moved on to create a new Boundle, I created it just fine but I found my self in troubles doctrine.....
I am following this tutorial : Tutorial Link
The part I have stumbled on in this tutorial is:
app/console doctrine:database:create
When I run this command in my terminal I get this error:
Could not create database for connection namedsymfony
SQLSTATE[HY000] [1045] Access denied for user 'root'#'localhost' (using password: NO)
Looking at this error it that I have wrong parameters to connect to database so I checked the parameters.yml.dis file and this is what i have in it:
`parameters:
database_driver: pdo_mysql
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
mailer_password: ~
locale: en
secret: ThisTokenIsNotSoSecretChangeIt
debug_toolbar: true
debug_redirects: false
use_assetic_controller: true`
I tried localhost instead 127.0.0.1
I tried MAMP database_port: 8889
I tried MAMP password whihc is: root
but i keep on getting the same error
also not to sure if revelant as my apache and phpmyadmi in on MAMP, but when i run this command in my terminal mysql -u root -p this is the terminal response: -bash: mysql: command not found
About the SQL login issue
Check http://localhost/phpmyadmin in the privileges panel to see if the user root has a password defined or not and if it is allowed to access mysql via localhost (or other hosts) and if it has permissions to any database.
About the MAMP issue
Since you do not have mysql installed globally, you don't have access to it from everywhere.
Your mysql is installed locally in your MAMP so you can access it using the /path-to-MAMP/bin/mysql or something similar.
I'm currently working on a website using Symfony2 and doctrine2 for the database. I did everything from this tutorial:http://tutorial.symblog.co.uk/docs/doctrine-2-the-blog-model.html
However, when I try to do this:
php app/console doctrine:database:create
I get this error:
Could not create database for connection named `CHuts_DB`
SQLSTATE[28000] [1045] Access denied for user 'rootDB'#'localhost' (using password: YES)
And this is my parameters.yml:
parameters:
database_driver: pdo_mysql
database_host: localhost
database_port: '3396'
database_name: CHuts_DB
database_user: rootDB
database_password: ***
...
database_path: null
I don't understand why it's not working. I'm fairly new to Symfony2 and I've searched a bit on internet but I couldn't find someone with the same error message as me.
In PHPMyAdmin go to:
Users -> rootDB -> Structure (check CREATE)
and save privileges of user.
I think your user and/or password aren't correct.
You can try mysql command line:
> mysql -u rootDB -p
or install adminer.php in your webserver and try to verify the account.
This solution worked for me on Mac OS X with MAMP (or MAMP Pro).
Add database.unix_socket in app/config/parameters.xml
parameters:
database.driver: pdo_mysql
database.host: localhost
database.port: 8888
database.name: my-database-name
database.user: root
database.password: root
database.unix_socket: /Applications/MAMP/tmp/mysql/mysql.sock
Add unix_socket in app/config/config.xml
# Doctrine Configuration
doctrine:
dbal:
# ...
unix_socket: "%database.unix_socket%"