can not find mysqlbinlog command in docker? - mysql

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

Related

After running "$ mysql -u root -p", it returns "No such file or directory"

In my local terminal, after running:
mysql -u root -p
it returns:
bash: /usr/local/mysql: No such file or directory
Yes, I have installed everything as:
(envir) MBPganghinanban:ADB_nov20_2021 xxx$ brew services stop mysql
Stopping `mysql`... (might take a while)
==> Successfully stopped `mysql` (label: homebrew.mxcl.mysql)
(envir) MBPganghinanban:ADB_nov20_2021 xxx$ mysql.server start
Starting MySQL
. SUCCESS!
(envir) MBPganghinanban:ADB_nov20_2021 xxx$ mysql.server stop
Shutting down MySQL
. SUCCESS!
The part I suspect is that I have executed this previously:
alias mysql=/usr/local/mysql
In addition, it also returns "No such file or directory" if I run:
mysql
I am not sure of not being able to execute "mysql -u root -p" while being able to login to the server. Please help.
Thanks to the community. I have followed the instruction from Cid, meanwhile I have used:
which mysql
Hence, I found the path of my installation is at: /usr/local/bin/mysql
Then
export PATH="/usr/local/bin/mysql”
The problem is solved!

zsh: command not found: mysql. MySQL is not compatible for zsh?

Isn't possible to install MySQL in zsh in macOS?
I have been trying to install MySQL on my Mac.
zsh: command not found: mysql
Should I give up setting MySQL on zsh and try to do in bash?
% brew install mysql#5.7
==> Downloading https://ghcr.io/v2/homebrew/core/mysql/5.7/manifests/5.7.32-2
Already downloaded: /Users/stackover/Library/Caches/Homebrew/downloads/abe6a0a4787f4c4bd9c6d14e27d98d868c1f0f619cbbba601e8225--mysql#5.7-5.7.32-2.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/mysql/5.7/blobs/sha256:82867504
Already downloaded: /Users/stackover/Library/Caches/Homebrew/downloads/8db250bb2773af3411c71cf86232ed647cdf9366670c716c52574d--mysql#5.7--5.7.32.arm64_big_sur.bottle.2.tar.gz
==> Pouring mysql#5.7--5.7.32.arm64_big_sur.bottle.2.tar.gz
==> Caveats
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
MySQL is configured to only allow connections from localhost by default
To connect run:
mysql -uroot
mysql#5.7 is keg-only, which means it was not symlinked into /opt/homebrew,
because this is an alternate version of another formula.
If you need to have mysql#5.7 first in your PATH, run:
echo 'export PATH="/opt/homebrew/opt/mysql#5.7/bin:$PATH"' >> ~/.zshrc
For compilers to find mysql#5.7 you may need to set:
export LDFLAGS="-L/opt/homebrew/opt/mysql#5.7/lib"
export CPPFLAGS="-I/opt/homebrew/opt/mysql#5.7/include"
To have launchd start mysql#5.7 now and restart at login:
brew services start mysql#5.7
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/mysql#5.7/bin/mysql.server start
==> Summary
🍺 /opt/homebrew/Cellar/mysql#5.7/5.7.32: 319 files, 233.7MB
stackover#stackoverjunoMacBook-Air ~ % echo 'export PATH="/opt/homebrew/opt/mysql#5.7/bin:$PATH"' >> ~/.zshrc
stackover#stackoverjunoMacBook-Air ~ % myql --version
zsh: command not found: myql
stackover#stackoverjunoMacBook-Air ~ % mysql --version
zsh: command not found: mysql
stackover#stackoverjunoMacBook-Air ~ % export LDFLAGS="-L/opt/homebrew/opt/mysql#5.7/lib"
stackover#stackoverjunoMacBook-Air ~ % export CPPFLAGS="-I/opt/homebrew/opt/mysql#5.7/include"
echo 'export PATH="/opt/homebrew/opt/mysql#5.7/bin:$PATH"' >> ~/.zshrc
export LDFLAGS="-L/opt/homebrew/opt/mysql#5.7/lib"
I checked if it installed:
stackover#stackoverjunoMacBook-Air ~ % mysql --version
but
zsh: command not found: mysql
I also tried this:
stackover#stackoverjunoMacBook-Air ~ % mysql -uroot
zsh: command not found: mysql
stackover#stackoverjunoMacBook-Air ~ % echo 'export PATH="/opt/homebrew/opt/mysql#5.7/bin:$PATH"' >> ~/.zshrc
stackover#stackoverjunoMacBook-Air ~ % mysql --version
zsh: command not found: mysql
Your shell does not automagically pick up new executables from your $path. For the shell to find the new executable, you will need to
rebuild your shell’s command lookup table with
hash -fr
restart your shell with
exec zsh
or open a new tab in your terminal.

Accessing MySQL5.7 Docker container results in zsh: command not found: mysql

I am simply trying to run MySQL container using Docker and access it in my localhost.
This may be simple and easy to solve, but i am really struggling to find solution.
I have been googling around with the following searches, but i have no luck.
"zsh:command not found: mysql using Docker"
"docker, z shell problem"
"docker, zsh:command not found"
"etc..."
I am assuming this has something to do with z shell, but I have no clue how to fix this.
Here are the steps I did in my iTerm2 terminal.
Run MySQL 5.7 docker container
docker run -d -p 3306:3306 \
-e MYSQL_ALLOW_EMPTY_PASSWORD=true \
--name mysql \
mysql:5.7
Access MySQL to test, but failed
$ mysql -h127.0.0.1 -uroot
zsh: command not found: mysql
You should install mysql-client to use mysql to connect on your container.
Because your MySQL is installed in a docker container and not in local via brew, you can access your MySQL interface by running
docker exec -it nameofyourMySQLContainer mysql -u root -p
Enter your password if you've set one up for the container and then you're in 👍

MySQL Cluster issue of ndb_mgmdon Centos7

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

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