MySQL Cluster issue of ndb_mgmdon Centos7 - mysql

Getting this error while entering the below command.
[root#localhost mysql-cluster]# ndb_mgmd -f /var/lib/mysql-cluster/config.ini
**-bash: ndb_mgmd: command not found**

I am unable to use the command of ndb_mgmd. Using MySQL 5.6.35 on Centos 7 64-bit
[root#localhost mysql-cluster]# ndb_mgmd -f /var/lib/mysql-cluster/config.ini
-bash: ndb_mgmd: command not found
This is my config.ini
enter image description here

Related

can not find mysqlbinlog command in docker?

run mysql docker run -d --name=mysql-server -p 3306:3306 -e MYSQL_ROOT_PASSWORD=t123456 mysql:8.0.30
find command: find / -name mysqlbinlog,it only return one line:
sh-4.4# find / -name mysqlbinlog
find: '/proc/1/map_files': Permission denied
and run mysqlbinlog commmand failed:
sh-4.4# mysqlbinlog
sh: mysqlbinlog: command not found
--update--
i change version from 8.0.30 to 8.0.23 according to can't find mysqlbinlog in docker container [mysql/mysql-server:8.0.23] , and the command can be found , why is it missed in newer version?
Available in latest debian version
8.0.30-debian

mysql command line with xampp in ubuntu 14.04

I installed xampp. After I type sudo /opt/lampp/lampp start into terminal, I get
$ sudo /opt/lampp/lampp start
Starting XAMPP for Linux 5.6.23-0...
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.
I changed the root password in /opt/lampp/phpmyadmin/config.inc.php
The password in localhost/phpmyadmin agrees with the change made in the config.inc.php file.
When I type mysql -u root -p into terminal I get
The program 'mysql' can be found in the following packages:
* mysql-client-core-5.5
* mariadb-client-core-5.5
* mysql-client-core-5.6
* percona-xtradb-cluster-client-5.5
Try: sudo apt-get install <selected package>
I installed mysql-client-core-5.6
$ sudo apt-get install mysql-client-core-5.6
[sudo] password for experiment:
Reading package lists... Done
After installing the client, when I typed mysql -u root -p into terminal I got
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Some threads suggest that multiple instances of mysql could be running.
When I type ps ax | grep mysql into terminal, I get
$ ps ax | grep mysql
7021 ? S 0:00 /bin/sh /opt/lampp/bin/mysqld_safe --datadir=/opt/lampp/var/mysql --pid-file=/opt/lampp/var/mysql/experiment-MP061.pid
7168 ? Sl 0:02 /opt/lampp/sbin/mysqld --basedir=/opt/lampp --datadir=/opt/lampp/var/mysql --plugin-dir=/opt/lampp/lib/mysql/plugin/ --user=mysql --log-error=/opt/lampp/var/mysql/experiment-MP061.err --pid-file=/opt/lampp/var/mysql/experiment-MP061.pid --socket=/opt/lampp/var/mysql/mysql.sock --port=3306
11112 pts/6 S+ 0:00 grep --color=auto mysql
I don't know how to interpret the output. Is this one instance of mysql?
Some threads suggest making changes to the my.cnf file. I don't have one. I do have a etc/mysql/my.cnf.bak file. Where should I put the my.cnf file?
Should I be able to use the mysql command line after installing xampp only or do I need to install a client?
My ultimate goal is to have a system where I can use xampp, Workbench, NetBeans, and the mysql command line.
To find the path where my.cnf or my.ini is picked up, issue a command
mysql --help
It will echo out a lot of info. Search thru the text to find a line like the following:
Default options are read from the following files in the given order:
C:\WINDOWS\my.ini C:\WINDOWS\my.cnf C:\my.ini C:\my.cnf C:\Program Files\MySQL\MySQL Server 5.7\my.ini C:\Program Files\MySQL\MySQL Server 5.7\my.cnf
or
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
It is buried right in the middle of the echo output.
Lastly,
$ sudo netstat -tlpn | grep mysql
tcp6 0 0 :::3306 :::* LISTEN 10954/mysqld
port 3306.
If you have a few daemons running, you will get multiple lines. You use the -P (uppercase) switch at the cmd line for the port number. Note that lowercase -p is for the password (either prompt for it or give it)

Ubuntu: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I have a Ubuntu 14.04. server with LAMP installed where an Owncloud is running. I tried to install paperwork which didn't work out but thats not the problem.
After restarting my server I tried to access my owncloud again but I am facing an internal server error. See following picture.
Owncloud error
I looked in the log /var/log/apache2/error.log and theres following phrase:
Lost connection to MySQL server during query' in ...
I tried to restart the mysql service but this error appears:
stop: Unknown instance:
start: Job failed to start
Then I tried to login to mysql with mysql -u root -p and follorwing error appears:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
I've looked for the sockets on the machine with find / -type s and the socket was there: /run/mysqld/ .
I created a symbolic link and pasted it to /var/run/mysqld/mysqld.sock
Unfortnutely nothing worked. After restarting again I can't find the socket anymore the output of find / -type s is:
/dev/log
/run/php5-fpm.sock
/run/udev/control
find: `/proc/977/task/977/fd/5': No such file or directory
find: `/proc/977/task/977/fdinfo/5': No such file or directory
find: `/proc/977/fd/5': No such file or directory
find: `/proc/977/fdinfo/5': No such file or directory
Update
I've reinstalled the server so problem is over :D
If you install lampp server, run mysql first
sudo /opt/lampp/lampp startmysql
Then make "mysqld" directory in /var/run
cd /var/run
sudo mkdir mysqld
Link your mysql from lampp to /var/run/mysqld
sudo ln -s /opt/lampp/var/mysql/mysql.sock /var/run/mysqld/mysqld.sock
run mysql -u root -p . hope may help you
If you install LAMPP server, run MySQL first
sudo /opt/lampp/lampp startmysql
Then make "mysqld" directory in /var/run
cd /var/run
sudo mkdir mysqld
Link your mysql from lampp to /var/run/mysqld
sudo ln -s /opt/lampp/var/mysql/mysql.sock /var/run/mysqld/mysqld.sock
run MySQL
mysql -u root -p .
If MySQL fails with «mysql» not found, install:
sudo apt install mysql-client-core-5.7
sudo apt install mariadb-client-core-10.1
There is any issues with the mysql services. Please try to restart mysql services and check the mysql error logs for more information

MySQL starting error on CentOS 6

I have removed the preinstalled MySQL from CentOS 6 using the command-
yum remove mysql mysql-*
Now, I want to install "MySQl-server-5.5.28-1.linux2.6.i386.rpm" in my system.
But it could not start on my system. Please tell me how to start the MySQL with user account as well as in root also.
I have done this:-
[rex#dhcppc0 MySQL]$
[rex#dhcppc0 MySQL]$ su -
Password:
[root#dhcppc0 ~]# cd /home/rex/Documents/Software/MySQL
[root#dhcppc0 MySQL]# rpm -i MySQL-server-5.5.28-1.linux2.6.i386.rpm
package MySQL-server-5.5.28-1.linux2.6.i386 is already installed
[root#dhcppc0 MySQL]# mysql -u
-bash: mysql: command not found
[root#dhcppc0 MySQL]# mysql -u mysql
-bash: mysql: command not found
[root#dhcppc0 MySQL]# mysql.server start
-bash: mysql.server: command not found
MySQL-server-xxxx is package that contains only MySQL Server. Executable file for server is "mysqld" - "d" letter is for a daemon).
File that you trying to execute (mysql) is MySQL client. There is no client application in server package.
Please install MySQL-client-xxxx package, where xxxx is a version.
Execute the initscript below as a root user:
# /etc/init.d/mysql start
If you try to access the database from local client, you need to install MySQL-client-5.5.28-1.linux2.6.i686.rpm package.
Then you can control the MySQL database.
$ /usr/bin/mysql -u mysql

How to start MySQL server from command line on Mac OS Lion?

I installed mySQL on my Mac. Beside starting the SQL server with mySQL.prefPane tool installed in System Preferences, I want to know the instructions to start from command-line.
I do as follows:
After
su root
I start the mySQL server by command-line, but it produces an error as below:
sh-3.2# /usr/local/mysql/bin/mysqld
111028 16:57:43 [Warning] Setting lower_case_table_names=2 because
file system for /usr/local/mysql-5.5.17-osx10.6-x86_64/data/ is case
insensitive
111028 16:57:43 [ERROR] Fatal error: Please read "Security" section of
the manual to find out how to run mysqld as root!
111028 16:57:43 [ERROR] Aborting
111028 16:57:43 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
Simply:
mysql.server start
mysql.server stop
mysql.server restart
Try /usr/local/mysql/bin/mysqld_safe
Example:
shell> sudo /usr/local/mysql/bin/mysqld_safe
(Enter your password, if necessary)
(Press Control-Z)
shell> bg
(Press Control-D or enter "exit" to exit the shell)
You can also add these to your bash startup scripts:
export MYSQL_HOME=/usr/local/mysql
alias start_mysql='sudo $MYSQL_HOME/bin/mysqld_safe &'
alias stop_mysql='sudo $MYSQL_HOME/bin/mysqladmin shutdown'
I like the aliases too ... however, I've had issues with MySQLCOM for start ... it fails silently ... My workaround is akin to the others ... ~/.bash_aliases
alias mysqlstart='sudo /usr/local/mysql/support-files/mysql.server start'
alias mysqlstop='sudo /usr/local/mysql/support-files/mysql.server stop'
As this helpful article states:
On OS X to start/stop MySQL from the command line:
sudo /usr/local/mysql/support-files/mysql.server start
sudo /usr/local/mysql/support-files/mysql.server stop
On Linux start/stop from the command line:
/etc/init.d/mysqld start
/etc/init.d/mysqld stop
/etc/init.d/mysqld restart
Some Linux flavours offer the service command too
# service mysqld start
# service mysqld stop
# service mysqld restart
or
# service mysql start
# service mysql stop
# service mysql restart
If you installed it with homebrew, the binary will be somewhere like
/usr/local/Cellar/mysql/5.6.10/bin/mysqld
which means you can start it with
/usr/local/Cellar/mysql/5.6.10/support-files/mysql.server start
and stop it with
/usr/local/Cellar/mysql/5.6.10/support-files/mysql.server stop
Edit: As Jacob Raccuia mentioned, make sure you put the appropriate version of MySQL in the path.
Maybe your mysql-server didn't start.
You can try
/usr/local/bin/mysql.server start
sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
make alias in .bash_profile
alias start_mysql="/Library/StartupItems/MySQLCOM/MySQLCOM start"
alias stop_mysql="/Library/StartupItems/MySQLCOM/MySQLCOM stop"
and if you are trying to run as root use following safe mode
sudo ./bin/mysqld_safe
if you are still having issues starting, a recommended read:
mysql5.58 unstart server in mac os 10.6.5
For me this solution worked on mac Sierra OS:
sudo /usr/local/bin/mysql.server start
Starting MySQL
SUCCESS!
My MySQL is installed via homebrew on OS X ElCaptain. What fixed it was running
brew doctor
which suggested that I run
sudo chown -R $(whoami):admin /usr/local
Then:
brew update
mysql.server start
mysql is now running
If it's installed with homebrew try just typing down mysql.server in terminal and that should be it.
AFAIK it executable will be under /usr/local/bin/mysql.server.
If not you can always run following "locate mysql.server" which will tell you where to find such file.
If you have MySQL installed through Homebrew these commands will help you:
# For starting
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
# For stoping
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
MySql server startup error 'The server quit without updating PID file '
if you have installed mysql from homebrew
close mysql server from preferences of mac
ps ax | grep mysql
#kill all the mysql process running
sudo kill -9 pid
which mysql
/usr/local/bin/mysql
Admins-MacBook-Pro:bin username$ sudo mysql.server start
Starting MySQL
. SUCCESS!
Admins-MacBook-Pro:bin username$ which mysql
/usr/local/bin/mysql
Admins-MacBook-Pro:bin username$ ps ax | grep mysql
54916 s005 S 0:00.02 /bin/sh
/usr/local/Cellar/mysql#5.7/5.7.27_1/bin/mysqld_safe --datadir=/usr/local/var/mysql --pid-file=/usr/local/var/mysql/Admins-MacBook-Pro.local.pid
55012 s005 S 0:00.40 /usr/local/Cellar/mysql#5.7/5.7.27_1/bin/mysqld --basedir=/usr/local/Cellar/mysql#5.7/5.7.27_1 --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/mysql#5.7/5.7.27_1/lib/plugin --user=mysql --log-error=Admins-MacBook-Pro.local.err --pid-file=/usr/local/var/mysql/Admins-MacBook-Pro.local.pid
55081 s005 S+ 0:00.00 grep mysql
On mac Big Sur and MySQL 5.7, I needed to stop/start with:
sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
and
sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
This answer came from https://coolestguidesontheplanet.com/start-stop-mysql-from-the-command-line-terminal-osx-linux/
In my case, I had downloaded the mysql server and installed it but I didn't click on the run server that showed up on the last installer page.
In order to start my server manually in the terminal (without adding aliases), I used this in the terminal and it works.
Start Server:
sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
Stop Server:
sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
More info at the link below:
https://www.databasestar.com/start-mysql-server/
111028 16:57:43 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
Have you set a root password for your mysql installation? This is different to your sudo root password. Try /usr/local/mysql/bin/mysql_secure_installation