ED command from wampserver [duplicate] - mysql

I am looking for a solution where I don't need to use up and down arrow keys for editing commands. Previously, there used to be an edit command that opened an editor for editing. However, now I am finding no such command exist on my installed MySQL latest version. I installed MySQL in developer mode. Help command is not showing any edit or \e command.

I never knew the edit command existed up until now and tried it in my 5.7 , with no luck of course. Then I did a bit of research. Taken from mysql reference manual for 8.0: MySQL Shell's \edit command (available from MySQL Shell 8.0.18) opens a command in the default system editor for editing, then presents the edited command in MySQL Shell for execution. So I suppose you were using MySQL shell instead of the run-of-the-mill CLI launched by mysql command (or unlocked it in CLI after installing mysql shell). Please download it from MySQL community. The latest MySQL Shell 8.0.29 will do. Personally, I have not got round to trying mysql shell and probably won't do in the future, as I find workbench is too good to part with.

Related

Meaning of mysql-ctl cli

I am still learning the majority of SQL commands out there so please excuse me for asking a noob question.
When I am using MySQL online, in order to begin the actual 'coding/programming' in SQL I need to use the following command:
mysql-ctl cli
I understand that 'cli' refers to the command line interface, i.e. the tool through which to access the MySQL programme but what does the 'ctl' refer to? What is actually happening with this entire command in the background - why does it need to be run on an IDE at all instead of just starting to code in SQL language?
Well usually you need just run
mysql --user=user_name --password=your_password db_name
but some environments have additional utilities to control mysql server which are made looking similar to oracle crsctl or srvctl you may find in RAC
ctl means control
So mysql-ctl cli - starts command line interface
mysql-ctl start - starts mysql server
mysql-ctl stop - stops mysql server
there is nothing extraordinary

I need to know if there is any other way to use sql command line without cmd

Do i need to go to cmd and execute "mysql -u root -p" command first ,to execute mysql commands. Isn't there any direct method to use sql commands on mysql.
You can try using MySQL Workbench for executing sql commands instead of cmd. In the latest versions of mysql installer, MySQL Workbench exists by default. So you can also try to upgrade your sql version. You can download latest version as per your os by this link: download
there is many SQL tool for this, sharing you a blog please consider for the best choice.
https://www.guru99.com/top-20-sql-management-tools.html

Confused with different types of MySQL applications to install

I'm very new to MySQL.
My question is about installation of MySQL on my Mac (Mojave OS) to learn and practice it to later use it with node.js.
First I got it with Homebrew, but then I wasn't able to use it with the Workbench - I set up the password for root user but I didn't find any commands list to work with it since it refused to do any operations with it in workbench and I didn't find any command.
Then I downloaded Community Server - I have a server through system prefs, but I don't have a command line interface - which I need for writing queries.
After that I downloaded MySQL Shell. But as far as I researched I found that is it not standard CLI (found it here https://stackoverflow.com/questions/58367813/how-to-uninstall-mysql-shell-on-macos).
My question is next.
As an example, when I started learning MongoDB I had MongoDB Compass and MongoDB Shell - one helped me to work with commands, the other one helped to see results visually.
MySQL has a language which I want to learn and practice with (SELECT, USE etc.). How can I do the same what I did with MongoDB but in the case of MySQL? What should I install, and why Homebrew MySQL version is different than any other MySQL version (even commands - such as mysql.server start) and there is no documentation for it in MySQL docs?
Unfortunately, there's no such nice installer for macOS as there is for Windows. Instead you have to install the different parts individually.
For the type of work you plan to do I recommend to install at least 2 pieces:
The MySQL server, which holds your data. On macOS this comes with a preferences pane, which you can use do some basic management of the server (start/stop, directory settings).
MySQL Workbench, a visual design, query and management tool. That will give you GUI support for your DB work.
The server also comes with the classic shell, which you can launch by running mysql in a terminal. That's sometimes quicker for simple work, compared to launching a full GUI.
A better command line tool is the MySQL Shell, a new and highly improved variant of the classic shell, which will eventually replace the old classic shell entirely in the future. So it's certainly no mistake to install that too.
I hope that clarifies which pieces are required to start working with MySQL.

How to execute os command from mysql5 for windows?

In mysql5.X database on Linux the command system or ! can be used to run bash command from database command line.
Are there equivalent commands as system or ! in mysql5.X database for Windows?
Linux:
mysql> !ifconig
Windows:
mysql> !ipconfig
The Windows command does not work!
In mysql5.X database (for Linux), command "system" or "!" can be used to run bash command from database command Linux.
You misunderstand.
This is not SQL command. This is command-line client command. And it will work only in CLI or another client which supports this command. It will NOT work if you try to send in to MySQL server directly by any technique.
Is there a equivalent command as "system" or "!" in mysql5.X database (for Windows)?
If used CLI version supports this command then it will work otherwise no. This not depends on MySQL server version.
Windows is not the same operating system, and as such the names of the tools internally are, in many cases, completely different, like ls vs. dir.
ipconfig is a Linux thing but it's also not necessarily a given that it'll be present. On more modern distributions the ip command is becoming the default. That's to say you'll need to lookup what the command you're going to run is, and verify that with testing.
You'll need to run the command appropriate for the environment you're running on, whatever that is.
That being said, running shell commands inside of the mysql> shell is highly irregular and should be a last resort. Doing it can be viewed as highly suspicious and may be restricted.

Recommended MySQL tuning utility for Windows

I have been using MySQL Tuner (http://mysqltuner.com) on Linux for a while and am quite comfortable with it. Now, for whichever reason, we have had to start hosting other websites on IIS. Is there a similar tuning utility that may recommend config changes to MySQL on Windows Server 2008?
Kind regards
I have just ported the mysqltuner.pl script to Windows - see http://mysqltuner.codeplex.com/. It uses the same checks as version 1.2 of the mysqltuner.pl script, but in a nice, friendly Windows application - no need to install Cygwin or Perl.
Ok so this is over a year after the question but I thought it relevant because you can actually still use the mysqltuner script if you combine it with Cygwin.
Install Cygwin
Make sure Perl is installed
Additionally I installed the mysql and the mysqld packages as well (Needed for the script to connect to a "remote" MySQL.
Copy the mysqltuner.pl script to your Cygwin user home directory (Found under cygwin_install_dir/home/your.user)
Start the Cygwin terminal
Run the script $ perl mysqltuner.pl --host mysql_host_ip --forcemem 512
If you encounter an error in the line of:
ERROR 1130 (HY000): Host 'somename.company.com' is not allowed to connect to this MySQL server
Go to the database server and add the appropriate user and privelages
You should now be able to use mysqltuner in a windows environment against local as well as remote MySQL servers.
...screenshots removed because I'm not allowed to use images yet, sorry.
Don't know of another tool (outside the MySQL Instance Configuration Wizard you can run) like mysqltuner which will not run unfortunately. You can install Perl on Windows, but when run the .pl file you will get an error about $PATH not having mysqladmin in it. Upon reading of the manual laughing, it plain as day states there is no Windows support for 1.2.0 version of tool.
You can see if these suggestions help in the interim:
http://www.mysqlperformanceblog.com/2006/09/29/what-to-tune-in-mysql-server-after-installation/
Edit: I just found this: http://www.webyog.com/webyog/monyogscreenshots
MONyog, it is a paid product, though. I installed the trial and it looks very promising. It monitors your SQL server and gives you alerts and recommendations based on those alerts. Might be worth a look. I cannot vouch for too much other than it has some nice information in just a short period of time.