Questions tagged as ['mysql']

Questions regarding the MySQL database server, client and tools.
Score: 0
Shu Shang avatar
Cannot start mysql service: Unit mysql.service is masked
cw flag

I am trying to install phpMyAdmin and it complained about not able to connect to MySQL server. It seems that the relevant services are not started but I cannot start it.

Here is the results of some commands I run.

# mysql -v
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
# service mysql stop
# service mysql start
Failed to start mysql.service:  ...
Score: -1
Rendiero avatar
Running a bash shell using a password with a cron job
cn flag

I have a bash shell to back up a database that requires a password to open it. I want to run on a cron job, but how do I make it run automatically without filling in the database password?

ubuntu server version : 20.04.3 Mysql version : 8.0.26

The command i tried : mysqldump -u root -p "dbname" > backupname.sql when I press enter, the system asks for password. when i remove -p, error occurs.

Score: 0
Mysql import to new mechine
gw flag

My mechine borked down. Only thing i have is the files of mysql in /var/lib/mysql

Is there a way to import it to new mechien without problems?

Score: 0
bbuck avatar
Htop shows a mysqld that isn't in filesystem?
gb flag

Upon cleaning up my filesystem and uninstalling services I don't use, I noticed that 'htop' shows what appears to be a MySQL daemon running at


The thing is I don't have any MySQL installed manually, and I purposely removed MySQL / Maria installations. When I look at the location:


It doesn't even exist on the filesystem. Systemctl status queries return nothing for 'mysql'  ...

Score: 0
RunRabbit avatar
MariaDB Won't Start After Installing
mx flag

I'm running an Ubuntu 20.4 server and I've recently removed mysql-server and mysql-client and am trying to get MariaDB up and running. I've installed both mariadb-server and mariadb-client. I stop and then try to restart maria db. I get the general error message:

Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl ...
Score: 0
Lucio C avatar
mysql debian-start[190181]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
fr flag

I am trying to set up MariaDB server under xubuntu 20.04 and import all the db's I had previously on another machine under xubuntu 18 (following the notes I took when doing it there coming from opensuse).

The installed mariadb has datadir in /var/lib/mysql, and contains only a "null" msyql db with a root user with no password (as tested entering as sudo mysql -u root mysql which requires my personal  ...

Score: 0
Jason S. avatar
Package Broken while installing MySQL Server
ru flag

When I try installing MySQL server I get this error. "E: Unable to correct problems, you have held broken packages."

$ sudo apt install mysql-server:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some ...
Score: 1
BlueSkies avatar
`sudo apt autoremove` returning with error messages
br flag

After running sudo apt autoremove in order to remove packages they are no longer needed I'm getting the following messages:


Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  apg colord-data gnome-control-center-faces gnome-online-accounts libcolord-gtk1 libcolorhug2 libgsound0 libgssdp-1.2-0 libgupnp-1.2-0
  libg ...
Score: 0
Spineless avatar
Cant instal mysql on Ubuntu 21.04
cn flag

I am working on a fresh install of Ubuntu 21.04 or a Dell R610 server.

I recently installed mariadb and a number of Wordpress sites. I had to remove, purge and autoremove the mariadb because of the error I will present here. At this point I am starting fresh install of mysql-server.

I did the following steps to install mysql-server

{lsb-release -a}

No LSB modules are available.
Distributor ID: U ...
Score: 0
Iosef avatar
Mysql in bash script
in flag

Hi Im running the following mysql query using a bash script:


set -f        # disable globbing
IFS=$'\n'     # set field separator to NL (only)

arr=($(sudo mysql -u root -h localhost  -e "USE mydb;SELECT * FROM sites" | awk 'NR>1'))

echo $arr

which is returning the following:

1       Jhon     Richards

Then I'm trying to get just the firstname (Jhon) and st ...

Score: 0
Scott2n avatar
Port listening but page not loading
in flag

I am able to start my port and it is listening but the webpage localhost:3001 does not load. I did just get a new laptop ND Hve installed node and mysql... is there something else that i am missing? i do have my path set to both files.

Score: 0
BlueSkies avatar
Problem installing MySQL - mysqld: Can't read dir of '/etc/mysql/conf.d/' (OS errno 13 - Permission denied)
br flag

I'm trying to install MySQL using:

sudo apt install mysql-server

and I'm getting the following message at the end of the process:

E: Sub-process /usr/bin/dpkg returned an error code (1)

The whole input/output:

ubuntu@ubuntu:~$ sudo apt install mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically in ...
Score: 1
Wisely avatar
Error on realpath() on '/var/lib/mysql-files' (Error 2 - No such file or directory) - "mysql-files" directory doesn't exist
ge flag

I am using Ubuntu to configure Wordpress on WSL. Currently, I am trying to install MySQL as part of the LAMP Stack using the following as per this tutorial:

sudo usermod -d /var/lib/mysql/ mysql
sudo service mysql start

When I run the second command, I see "fail" in red appear (ie. mysql won't start). Here is what the Error Log looks like:

2021-09-05T08:17:59.936284Z mysqld_safe Logging to '/var/log ...
Score: 0
mhisham avatar
Cannot run mysql on ubuntu 21.04
in flag

I am having a hard time running mysql on ubuntu 21.04. I tried:

sudo apt remove --purge mysql-server
sudo apt purge mysql-server
sudo apt autoremove
sudo apt autoclean


sudo systemctl stop mysql
sudo apt purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*
sudo rm -rf /etc/mysql /var/lib/mysql /var/log/mysql
sudo apt autoremove
sudo apt autoclean

before reinstallin ...

Score: 0
Abayomi Usman avatar
how to resolve the error installing and uninstalling mysqljs/mysql caused
in flag

immediately I installed mysqljs/mysql my IP address started throwing the error:

502 Bad Gateway
nginx/1.18.0 (Ubuntu)

and even after I uninstalled it my IP is still having the same error. I then tried to re-install it as root, then it threw the error:

npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects clone ssh:// /ro ...
Score: 0
Abayomi Usman avatar
server not rendering website after failed mysql server configuration
in flag

I started getting this error when I installed mysql_server on my server as root, I am using ufw, I don't know if I am supposed to allow mysql server through my ufw if I am supposed to, I don't know how, also on my local server I'm getting this error:

    throw err;

Error: Cannot find module 'mysql'
    at Function.Module._resolveFilename (internal/modules/c ...
Score: 0
Bradley Armstrong avatar
MYSQL 8 cannot connect from remote machine
us flag

I've setup a new 20.04.03 LTS Server. I can connect to MySQL locally, but can't connect from workbench on remote machine.

I've created my user username@% and granted all permissions.

I went an edited sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf and added bind_address = The line was not already in there.

I've logged into mysql on the localhost and checked

mysql> show variables like "%bin ...
Score: 0
thomas avatar
mysql 5.7 - ubuntu 21.04
co flag

Is it possible to install mysql 5.7 on ubuntu 21.04?
I have tried this :
But it doesn't seem to work.

Score: 0
Blank avatar
I did apt remove mysql-common but instead ended up removing gnome-control-center and ubuntu desktop utilities along side
mp flag
Start-Date: 2021-09-01  20:39:05
Commandline: apt purge mysql-server
Requested-By: user (1000)
Purge: mysql-server:amd64 (8.0.26-0ubuntu0.20.04.2)
End-Date: 2021-09-01  20:39:07

Start-Date: 2021-09-01  20:39:27
Commandline: apt autoremove
Requested-By: user (1000)
Remove: mecab-utils:amd64 (0.996-10build1), libevent-core-2.1-7:amd64 (2.1.11-stable-1), mysql-server-8.0:amd64 (8.0.26-0ubuntu0.20.04.2), lib ...
Score: 1
Marc Vanhoomissen avatar
How to solve bacula warning '"dbi:mysql" mismatched with the Database argument "MySQL" after upgrade?
in flag

I recently upgraded a server from Ubuntu 18.04 to 20.04. After that, I keep getting a warning from bacula-daemon:

31-aoû 05:02 bacula-dir JobId 0: Warning: Dbdriver field within director config file "dbi:mysql" mismatched with the Database argument "MySQL" passed during Bacula compilation. 

If mysql is not appropriate for MySQL, then what is appropriate? What should I use?

Score: 0
Hkm Sadek avatar
After running a long running task on mysql node.js my var/lib/mysql folder has become full
in flag

I was trying to run a long running task that update a database and database size is around 2GB and total server disk size is 25GB.

So now we are seeing that server is full. When run df -h in /var/lib/mysql# here is the result I get:

Filesystem      Size  Used Avail Use% Mounted on
udev            2.0G     0  2.0G   0% /dev
tmpfs           394M   41M  354M  11% /run
/dev/vda1        25G   25G     0 100% /
Score: 0
Marisa Giancarla avatar
How do I get mysqli set up for accessing in php7.4 in Ubuntu 20.04?
de flag

Im setting up a new server on Ubuntu 20.04, and installed the LAMP apps. apache2 works fine and is accessing the PHP modules fine with the exception of getting the MySQLi database connection working. If I do: php -m It does say that mysqli is loaded and there, but when restoring my joomla backup it can't get past the point of connecting to the database.

Any help?

Score: 0
Hern avatar
Is it possible to use ED448 and ED25519 in phpmyadmin and MySQL?
sb flag

I would like to know is it possible to login into MySQL or PHPMyadmin with the same login mechanism like SSH key login?

The mechanism behind SSH key login was digital signature with challenge and respond. Is it possible to just put public key into MySQL/Phpmyadmin just like SSH so that the authentication can rely on public key authentication and cryptography randomness instead of relying on probl ...

Score: 0
synsteph38 avatar
MySQL server on Ubuntu server 18.04.1 LTS no more responding correctly
in flag

I've made an upgrade form 16.04 to 18.04.1 without apparently any problem (hosted on a 1&1 dedicated server) This server is running different Joomla! based sites Had to restart MySQL server and then no more any response form MySQL server

Have tried re-installation with :

sudo apt-get remove mysql-server
sudo apt-get install mysql-server

Without any luck (ie none of our sites are running now) Tried to ...

Score: -1
Iosef avatar
How can select data from mysql using bash script and pass it to php?
in flag

This is what Im trying now

In PHP Im running the following sript:

exec('/home/user1/', $output, $return_var);


Which is calling the following Bash script:

declare -A arr == $(sudo mysql -u root -h localhost -e "USE mydb;SELECT * FROM users")

for i in "${arr[@]}"
echo "$i"

Php is printing a empty array, what is wrong here?

Score: 0
Preman Terminal avatar
How to insert and update data from CSV using sqlcmd on ubuntu 20.04?
in flag

I can convert data database to .csv using sqlcmd syntax on my ubuntu

sqlcmd -S ipdb -U sa -P "passwordsa" -d dbname -Q "select * from tabelname" -o "direktori/file.csv" -s"," -W -w 700

but how can I insert data from my .csv to table using sqlcmd syntax?

Score: 0
Upgrading MySQL from 5.7 to 8 on Ubuntu 18.04 (Bionic)
pk flag

Just as the title said. I tried to upgrade to MySQL 8 on my Ubuntu 18.04 box. I downloaded mysql-apt-config_0.8.12-1.all.deb,updated and then tried to upgrade. The following is the outcome from my terminal:

faiz@faiz ~ > sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb 
dpkg: error: dpkg frontend is locked by another process
faiz@faiz ~ > sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb 
Selecting previ ...
Score: 0
Apache and/or MySQL Blown Away Mysteriously
br flag

I am using Ubuntu 20.04 under VirtualBox with Windows 10 as the host. The problem I had has occurred to me twice within 3 days.

I am doing Drupal development work with a fairly large database which I had to occasionally reload. My disk usage is at 75% but later on I see it climbing to as high as 90%. I try to clean up as much as I can but disk usage is still climbing. Over time, Apache and MySQ ...

Score: 0
Julien Rodger avatar
How do I reverse chmod 777?
in flag

While trying to fix mySQL I seem to have made a huge mistake running sudo chmod -R 777 / var/lib/mysql which seemed to have change everything to green folder instead of purple and now even files like sudo won't work.

I am logged onto SSH as a root user. How do I become the "owner" and able to access all the files again?

Score: 0
Amel ha avatar
How to use Sqoop/Flume import on Jupyter notebook?
pw flag

I've been able to use Sqoop/Flume import command perfectly on Ubuntu terminal. But right now, I'm trying to do so on Jupyter notebook.

How can I import from MySQL to HDFS using Sqoop import command and Log files from twitter using Flume on Jupyter notebook?