Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [mysql]

An open-source, relational database management system.

-1
votes
2answers
178 views

Changing root mysql password failed when done from mysql CLI

Consider the following code: UPDATE user set password=PASSWORD('NEWPASSWORD_CAME_HERE') WHERE User='root'; Where it is written NEWPASSWORD_CAME_HERE I've putted my password (between the quote marks)....
1
vote
2answers
38 views

Mysql CLI - continue execution even if the operation failed

Please consider this code: mysql -u root -p << MYSQL drop user '${test}'@'localhost'; drop database ${test}; create user '${test}'@'localhost' identified by '${psw}'...
0
votes
1answer
28 views

Making create DB user and create DB instance, run over existing values with the same name

I tried to recreate a DB user and a DB instance (run over the existing ones), so I ran the following two commands in the Mysql CLI: create user '${test}'@'localhost' identified by '${psw}'; create ...
0
votes
2answers
197 views

how to import customers to dolibarr

I have a rough and ready table as: mysql> mysql> show tables; +----------------------+ | Tables_in_businesses | +----------------------+ | 2017july | +----------------------+ 1 row ...
0
votes
2answers
28 views

Program to instantly host a mysql database from a dump file [closed]

I'm looking for a utility program which can take a dump of a mysql database and basically host a "fake" or minimal mysql server with that data for testing another program which requires it. Has ...
0
votes
1answer
222 views

MySQL on Western Digital NAS

A WD MyCloud device: root@WDMyCloud root # uname -a Linux WDMyCloud 3.10.39 #1 SMP Fri Aug 5 11:16:40 CST 2016 2014T20p4 Build-git3f24b4d armv7l GNU/Linux root@WDMyCloud root # cat /proc/...
1
vote
1answer
600 views

Making mysql CLI ask me for a password interactively

I use the following code as part of a much larger script: mysql -u root -p << MYSQL create user '${DOMAIN}'@'localhost' identified by '${DOMAIN}'; create database ${DOMAIN}; GRANT ...
14
votes
1answer
1k views

Why does piping to 'tail' change the contents of a line?

When I view the result of a SELECT with MySQL Workbench, it's correct with one single \ max@host 10:13:58: ~$ mysql -h db-master.domain.local -uuser -ppw db -e ' > SELECT > ...
0
votes
1answer
759 views

MySQL Select with function IN () with bash array

How can I do this with an array? (without storing the array as regular variable) VAR='String1 String2 String3' SELECT * FROM db.table WHERE xy IN ( ${VAR// /, } ); not working example: SELECT * ...
1
vote
1answer
22 views

Mysql database doesn't get deleted after deleting a user fully privileged on it

I've created an authorized, all privileged DB user, including a DB with the same name: create user 'test'@'localhost' identified by 'blablabla'; create database test; GRANT ALL PRIVILEGES ON test.* ...
1
vote
1answer
66 views

How to know if a mysql user has all (or some) privileges on a certain DB?

How to know if a mysql user has all (or some) privileges on a certain DB? Of course, I don't ask how to do so with phpmyadmin, rather, with the mysql CLI. I aim to gather as much as basic data on a ...
1
vote
1answer
124 views

How to associate and authorize a mysql DB user with a mysql DB, in mysql CLI?

In a test environment, I created a user and a DB with the same name this way: create user 'test'@'localhost' identified by 'blablabla'; create database test; When I came to associate the user with ...
1
vote
2answers
28 views

Listing all users in mysql root DB

In mysql CLI I did show databases; I then got a list of all DBs. How could I list all users? show users; didn't work, and I didn't find a command here in a quick search.
0
votes
3answers
467 views

How to connect to mysql remotely via SSH tunnel without password

On the server, I've got it set up, that the root doesn't need to enter password in order to use mysql (credentials are in ~/.mylogin.cnf). Now I want to connect to the mysql remotely via SSH tunnel ...
3
votes
3answers
126 views

Preventing any external mysql login tries

How to prevent any external logins to my Mysql database? That is, how to make sure that the only way my database could be manipulated is to login to my machine with SSH and work as root/sudoer. My ...
0
votes
2answers
825 views

Ubuntu 16.04 libmfhdfalt.so.0 is missing

I tried both install Mysql Workbench using .deb package and apt. Always returns the same error when launching it. I tried uninstall and install it again back and forth and the same error occurred. ...
1
vote
2answers
107 views

Combining a parameter argument inside an echo [duplicate]

I use the following script to do the following actions in my environment: Creating an Nginx site conf. Creating a corresponding Let'sEncrypt SSL certificate. Creating a symlink between my sites-...
1
vote
1answer
116 views

Change MySql root password

Is this correct to change the root password of MySql? echo "use mysql; update user set password=PASSWORD("NEWPASSWORD") where User='root'; flush privileges; quit;" | mysql -u root -pOLDPASSWORD I've ...
0
votes
1answer
22 views

Calculating MyQL PXC gcache

I was trying ti figure out how to calculate the right gcache for my server and came across the following post discussing just how to do that: https://www.percona.com/blog/2014/09/08/calculate-correct-...
0
votes
1answer
392 views

2002 - Network is unreachable - The server is not responding (or the local server's socket is not correctly configured)

I can't login to PHPMyAdmin getting error as #2002 - Network is unreachabl, I installed PHPMyAdmin from source. Configuration I tried in config.inc.php to fix the issue. $cfg['Servers'][$i]['host'] =...
1
vote
1answer
86 views

Creating an autorized, all privileged user and an identically named DB via CLI (Bash) in one row

I frequently need to do the following things in MySQL: Create a non-root user Set that user's password Grant that user all privileges Make a database with the same name as the new user Allow usage ...
5
votes
1answer
1k views

Cannot install phpmyadmin

I cannod install phpmyadmin. The installation process fails with the following error. I can normally log in to the mysql database. What should I do? Normally I would expect "(using password: Yes)". ...
-1
votes
2answers
344 views

selecting and purging binary logs through Shell script

let suppose this is the master binary log and i want to purge the binary logs upto "mysqld-bin.000002" to free some space in disk. I want to do this with shell scipt.
0
votes
2answers
1k views

Use the output and exit code of a mysql command in an if statement

Early in this script users and their credentials are read into variables. The following code works as intended to check the credentials of a mysql user. lu="test" lp="test-password" ldb="local_db" ...
0
votes
1answer
905 views

mysql query formatting in email

I have the following query in shell script: mysql -e "use hive; select DISTINCT TAB.DB_NAME, TAB.TABLE_NAME from TABLE_PARAMS INNER JOIN TAB ON TABLE_PARAMS.TBL_ID = TAB.TBL_ID where PARAM_KEY = '...
2
votes
1answer
2k views

Can't access MySQL without running sudo

I recently install MySQL on an ARM system (RBPI3), if I run: pi@raspberrypi:~ $ mysql -u root ERROR 1698 (28000): Access denied for user 'root'@'localhost' But with sudo it connects: pi@raspberrypi:...
-1
votes
2answers
305 views

MySQL - backup without overwriting old backups [closed]

How can I make this backup without overwriting old backups? here is the crontab that I made: * 2 * * * /opt/bitnami/mysql/bin/mysqldump -u root -password--databases BDname>~/Backup/DBname
-1
votes
5answers
4k views

Use a password in shell-script

I want to create a cron script to interact with mysql, for example #!/bin/bash mysql -uroot -p echo root echo "CREATE DATABASE example" But it doesn't work, it only prompts: Enter password: and ...
0
votes
1answer
219 views

MySQL Remote connection not succeeding

I'm trying to connect to a MySQL db remotely for about 10 hours with no luck. The server is running Debian. The my.cnf is configured correctly with bind-ip 0.0.0.0 and no skip-networking. lsof -i :...
0
votes
0answers
448 views

Does CentOS 7 stop services upon shutdown?

I have installed several services such as MySQL database and nginx on a CentOS 7 machine. I would like to know if CentOS automatically stops all of the installed services upon receiving a shutdown ...
2
votes
1answer
42 views

MySql client prompt is occasionally broken

I've got a weird bug with the MySQL prompt which has always annoyed me. Sometimes when I type for example: mysql > select * from users where I will press backspace and the prompt will suddenly ...
0
votes
1answer
200 views

MySQL NDB Management Node Got Different Node IP Address Against the config.ini

I am engaging with a MySQL HA configuration. Currently, I setup the config.ini on my management node: root@ndb-mgmd:~# cat config.ini |grep -v ^# [tcp default] SendBufferMemory=2M ...
0
votes
1answer
269 views

changing mysql --log-error to --syslog

I am using here MySQL 5.7.19 from Oracle in Debian Jessie and Stretch. ps ax | grep mysql /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --log-error=...
0
votes
1answer
35 views

MySQL in debian namespace

I have a debian jessie box and i installed a debian jessie debootstrap namespace. I install the mysql service inside the jail and i get error when i try to start the mysql service. How can fix this? /...
3
votes
5answers
21k views

error processing package mysql-community-server during apt-get upgrade

How can I solve this problem? root@ip-*******:/# apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done ...
0
votes
1answer
337 views

mydumper segmentation fault in g_ascii_strtoull

I'm trying to use mydumper to generate a dump of my mysql databases, that I could use to restore the databases later in case of disaster. However, it just doesn't work. I use this command line: ...
0
votes
2answers
2k views

Read mysql column result in awk variable

I am unable to read single VALUE from mysql Query in awk.I am able to read it in bash but not in awk. I want to read the result variable in awk as I want to fire the query only based on some dynamic ...
1
vote
1answer
84 views

Cannot connect to MySql using PHP on Linux

I am creating some login pages on Linux using PHP and MySql. It worked perfectly before. However, all of a sudden, I start to get the PHP code on a browser instead of the table that was displayed ...
2
votes
0answers
2k views

“You have held broken packages” when trying to update mysql

I'm tryng to update my mysql (currently at version 5.6) to 5.7 on my Debian 8, however I get this error when I'm reaching the last step. cat /etc/apt/sources.list gives the following: deb http://...
0
votes
1answer
178 views

Save daily mysql row count change in RRD

EDIT: To make things clear: I have an integer called $blocks or something, which increases everyday. I want to make a graph with RRDtool, that shows the "increased" amount for everyday. So if my $...
0
votes
1answer
30 views

Is there a command link wizard to create a new MySQL username and a DB with the same name + password?

Is there a command link wizard to create a new MySQL username and a DB with the same name + password? As for now, I always do so online from PHPmyadmin, but would like to automize this process from ...
1
vote
1answer
558 views

Fun with Ubuntu 16.04 and mysql [closed]

I want to thank you in advance if you manage to get all the way through this post and give me some ideas. It's a lot. I am on Ubuntu 16.04 on a 64bit Dell 1820. It is dual boot with Windows, and I'...
0
votes
1answer
69 views

Best way to migrate many SQL databases

So I'm switching VPSs, and have already done a backup of all the data files and moved them over. However I still need to move all the old databases over. I've been searching the internet for the best ...
-1
votes
1answer
1k views

can't start mysql after installation

I'm trying to install Wordpress on my Manjaro Linux machine using the guides here but I'm running into issues with mysql, it install ok but gives the following error when I try to start it sudo ...
0
votes
2answers
271 views

Deleting MySQL database with a “-” in the name

One member of the dev team managed to create one databases with a "-" in the name with a remote graphical interface (and I think the second one is a legacy DB). I am trying to remove both of them ...
3
votes
1answer
57 views

How can I tell which program is accessing mysql?

My server has been really sluggish recently. I checked with htop, and it's often stalling on disk reads. I checked with atop and iotop, and it looks like mysql is demanding a lot of diskIO. I haven't ...
0
votes
3answers
1k views

mysqldump command not working in cron job

I am trying to take backup using below bash script scheduled in cron. #!/bin/bash echo "Hello" while read table do /usr/bin/mysqldump -uroot -pxxxxxx CMAYA_RadiusUserLogs $table > sc_back/${table}...
0
votes
1answer
673 views

Where is the BASEDIR for MySQL installed with APT on Ubuntu?

According to the MySQL document, 2.10.1 Initializing the Data Directory: Change location into the top-level directory of your MySQL installation, represented here by BASEDIR: shell> cd ...
0
votes
1answer
517 views

mysql automation through expect

i need to automate mysql_secure_installation process, i have written this script but its failing miserably,, i dont want to set any passwrd for database #!/usr/bin/expect set timeout 10 spawn ...
1
vote
1answer
258 views

Using MYSQLDUMP to backup automatically a DB server

I'm using the following in crontab: 36 22 * * * root mysqldump -u CENSORED -p CENSORED server | gzip > /home/samp/samp03/scriptfiles/sql-backup/server_backup_`date + \%d-\%m-\%y`.sql but I'm ...