Mysql on the command line (can't use all keyboard buttons) - mysql

Using mysql directly from the command line (running on Ubuntu 9.10, standard bash terminal), I am unable to use certain keyboard buttons like:
Delete, Control-(arrow right), Control-(arrow left)
Which gets returned to me as:
~;5C;5D
respectively. I'm assuming there must be a flag in mysql that fixes this but I have been unable to find one. Is there a .mysqlconfig file to edit to make this happen on startup?

According to this thread and mysql --version, mysql is compiled with editline instead of readline. From that thread:
I had to add create an .editrc file with the following lines to get ctrl-R and DELETE to work.
bind "\e[3~" ed-delete-next-char
bind "^R" em-inc-search-prev
Although that didn't work for me.
Another suggestion from that thread did work:
$ sudo apt-get install rlwrap
Then add an alias in ~/.bashrc
alias mysql='rlwrap -a mysql'
This problem may be specific to Ubuntu 9.10

Related

Issues starting MySQL server Mac

There are red dots, rather than green dots, next to "Active Instance" in the preference pane. Image here. When I click "Start MySQL Server" the lights flash green very briefly before turning red again. In other install tutorials (e.g. this), this doesn't happen.
However, when I try to use command line to start the server, with sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist I get the line /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist: service already loaded Load failed: 37: Operation already in progress. So it seems like some parts are already loaded.
When I try to launch MySQL (with mysql -u root -p), I get the error:
dyld: Symbol not found: __ZTTNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE Referenced from: /usr/local/mysql/bin/mysql (which was built for Mac OS X 12.0) Expected in: /usr/lib/libc++.1.dylib in /usr/local/mysql/bin/mysql Abort trap: 6
I get the same error when I try to do mysql --version.
Previously, I was getting the error -bash: mysql: command not found, but then I followed the suggestion here and added the path export PATH=$PATH:/usr/local/mysql/bin. (Note that I still get the -bash: mysql.server: command not found when I try mysql.server start, so I don't know if the new path export fixed the problem altogether.) I re-installed MySQL from the DMG but still getting this error.
Additional information that may be relevant:
-I am on Mac OS X 11.6.5.
-I have uninstalled/re-installed MySQL several times
-I copied my.cnf and put it in the "Configuration File" spot in preferences, with the file path: /private/etc/my.cnf. This is also a part where it's possible I went wrong, since I don't exactly know what I'm doing; I just tried to follow directions from here, here and used the actual code from here. I also tried putting the my.cnf file in /usr/local/mysql, as some other sources seem to suggest. This did not work either.
Solved: what I needed to do was uninstall MySQL and instead download an archived version of it--8.0.24 instead of the latest, 8.0.32, because it hadn't been compatible with my Mac version.

I don't know why the qemu-system error occurs

Why does an error appear as shown in the picture?
Is the command wrong?
Before entering that command, I entered the following:
apt-get update -y
Download vmlinux-3.2.0-4-4kc-malta or debian_wheez_mips_standard_qcow2 using wget command
The -redir option was removed in QEMU 3.1: https://www.qemu.org/docs/master/about/removed-features.html#redir-removed-in-3-1
You need to update the command line to use the newer syntax instead.

Why new version of MySQL installation file shows the old version prompt?

The current installed MySQL version on my server (ubuntu 18.04) is 5.7, I need to update it to 8th version .. I'm following this instruction.
I'm at /home/martin# path and I executed apt-get update and apt-get upgrade as well. I've also executed this wget https://dev.mysql.com/get/mysql-apt-config_0.8.22-1_all.deb and the installation file downloaded correctly.
Now, when I run this dpkg -i mysql-apt-config_0.8.22-1_all.deb, I get a prompt with old version:
See? it's still mysql-5.7. Why?
The expected result (based on the instruction) should be mysql-8.0.
Well it says "currently selected: mysql-5.7", but what happens when you actually select that item? As this is the Package configuration step it may well be that this is actually what's going to do the actual configuration replacement, so replacing 5.7 with the more recent install

mysqldump not found (Wordmove). How to correctly set up a symlink in Zsh?

I have searched through related questions but have still not found an answer to this one.
I am using Wordmove to try and push/pull databases between local and live environments for WordPress (running on AMPPS on OSX). I have come back to trying the Wordmove method since the fork of WP-Sync-DB stopped working for me and appears to be abandoned now. This was the best free method for migrating databases between WordPress environments.
The error I am getting when running wordmove pull -e runcloud --db is sh: mysqldump: command not found
I am using Zsh and have already added a symlink to the only mysqldump I could locate on my system: alias mysqldump='/Applications/AMPPS/mysql/bin/mysqldump --host=localhost -uroot -proot' in .zprofile . It is also included in my .bash_profile . Without that line I simply get mysqldump not found (verified by commenting the line and needing to restart iTerm after each change).
So now if I type which mysqldump I get mysqldump: aliased to /Applications/AMPPS/mysql/bin/mysqldump --host=localhost -uroot -proot
But the error from Wordmove persists. I have enquired on the Wordmove Github and the author says this will be an error with how mysqldump if configured.
Disclaimer: I am not at all expert with CLI, only knowing enough to configure an environment for Gulp, using tools like Wordmove and basic stuff over SSH. I chose Zsh as it made a lot of stuff easier to use and to see, but any kind of configuration for this usually has me scratching my head!
Have I missed something obvious here? Perhaps the symlink is not set up correctly?
I see two conceptual problems here:
(1) You can not export an alias. An alias defined in the current Zsh, won't be automtaically be visible in a child Zsh.
(2) Your error message says
sh: mysqldump: command not found
which means that Zsh is not even involved when looking for mysqldump. This is a Posix shell script running.
Hence, every mechanism you want to use must work with Posix shell, which means that you need a program (a suitable shell script) named mysqldump in your PATH, which then calls the original mysqldump with the parameters you have in mind.
Make sure that the PATH is set up so that your private version of mysqldump is found before the one in /Applications/AMPPS/mysql/bin.

Can't start mysql in terminal for OSX 10.8 with standard XAMPP stack installation

Error
sql: command not found
.profile code
export PATH=/opt/local/bin:/opt/local/sbin:/Applications/xampp/xamppfiles/bin:$PATH
I've edited the filed saved it and tried multiple versions and unable to get mysql to start
Type whereis sql and put whatever it prints into your PATH, minus the program name. e.g, if it prints usr/bin/sql, then makes sure /usr/bin is in your PATH.
To start mysql, you type mysql not sql. Hope that helps.