You are not logged in.

#1 2022-03-29 12:58:17

byjove01
Member
From: Alps, France
Registered: 2021-02-15
Posts: 207

[SOLVED] Can't access MariaDB/MySQL from terminal, only via phpmyadmin

The problem fits in the title. I want to export my SQL database to a portable format which I could use with SQLite but phpmyadmin, because of a recent bug, prevents me to do so. So, I decide to bypass it by using "mysqldump" but I got this error:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

... And this even happens with "mysql", "mariadb" or any SQL-related function. I tried to add my user and the root user in the http group, to execute "mysql" in any way I could imagine, but nothing would solve the issue.
However, as I said before, I can however use phpmyadmin with no problem at all, but it could be due to Apache using its own permissions or something else I don't know.

That's all the info I can give for now, if you need more, just ask. Thanks in advance.

Last edited by byjove01 (2022-03-31 09:52:35)

Offline

#2 2022-03-29 13:23:09

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Can't access MariaDB/MySQL from terminal, only via phpmyadmin

Please post the full command you are trying to run.
You need to use the username/password from a relevant mysql account, this is different to any system user accounts. You will have set this up when first configuring the database server.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2022-03-29 13:30:19

byjove01
Member
From: Alps, France
Registered: 2021-02-15
Posts: 207

Re: [SOLVED] Can't access MariaDB/MySQL from terminal, only via phpmyadmin

sudo mysqldump [databasename]

I finally succeed to access MariaDB just by putting the " -p [database name] " after my username. But I still can't dump anything, and "mysqldump" returns me that error.

Last edited by byjove01 (2022-03-29 13:31:13)

Offline

#4 2022-03-29 13:48:53

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Can't access MariaDB/MySQL from terminal, only via phpmyadmin

First off you shouldn't be using sudo for this.
The correct structure for the command should be...

mysqldump -u <username> -p <databasename>

Where <username> is the name of a mysql user with the appropriate rights.
Again, this isn't the name of a normal user on your system. It's a user that you had to specifically set up for mysql/mariadb when you first configured it.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2022-03-31 09:52:20

byjove01
Member
From: Alps, France
Registered: 2021-02-15
Posts: 207

Re: [SOLVED] Can't access MariaDB/MySQL from terminal, only via phpmyadmin

Thanks you, it worked. Problem solved.

Offline

Board footer

Powered by FluxBB