0

I have installed mysql version:8.0.32 using tar file. I am able to run mysql command only from bin dir inside the mysql dir.

Logs:

[memsql@rnd-4 mysql-8.0.32-linux-glibc2.17-x86_64-minimal]$ ls
bin  data  docs  include  lib  LICENSE  man  README  share  support-files
[memsql@rnd-4 mysql-8.0.32-linux-glibc2.17-x86_64-minimal]$ pwd
/home/memsql/mysql-8.0.32-linux-glibc2.17-x86_64-minimal
[memsql@rnd-4 mysql-8.0.32-linux-glibc2.17-x86_64-minimal]$ cd bin/
[memsql@rnd-4 bin]$ ls
ibd2sdi         myisam_ftdump      mysql        mysql_config         mysqld_safe    mysql_migrate_keyring      mysqlslap            perror
innochecksum    myisamlog          mysqladmin   mysql_config_editor  mysqldump      mysqlpump                  mysql_ssl_rsa_setup  test_dump_file.sql
lz4_decompress  myisampack         mysqlbinlog  mysqld               mysqldumpslow  mysql_secure_installation  mysql_tzinfo_to_sql  zlib_decompress
myisamchk       my_print_defaults  mysqlcheck   mysqld_multi         mysqlimport    mysqlshow                  mysql_upgrade
[memsql@rnd-4 bin]$ ./mysql -u <user> -h <host-ip> -P <port number> -p<password>;
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 100
Server version: 5.7.32 SingleStoreDB source distribution (compatible; MySQL Enterprise & MySQL Commercial)

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> exit
[memsql@rnd-4 bin]$ ./mysql --version
./mysql  Ver 8.0.32 for Linux on x86_64 (MySQL Community Server - GPL)

When I tried to run mysql command from other than bin dir, its giving error:

[memsql@rnd-4 mysql-8.0.32-linux-glibc2.17-x86_64-minimal]$ ./mysql --version
-bash: ./mysql: No such file or directory
[memsql@rnd-4 mysql-8.0.32-linux-glibc2.17-x86_64-minimal]$ mysql --version
-bash: mysql: command not found

I think environment variable can be set for command ./mysql to run this command from any path. Pls let me know how to do it. I can only use tar base installation for mysql application.

Divyank
  • 137
  • 6

0 Answers0