Meaning of mysql-ctl cli - mysql

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

Related

ED command from wampserver [duplicate]

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.

Can't Connect MYSQL server to VScode & General SQL installation issues

How do I install MySQL Workbench properly? Can't connect to the SQLTools extension in VSCode.I'm new to the database scene, and can't seem to grasp how to create a successful SQL server that I can use to manipulate data. But nothing I'm doing seems to work.
Should I use Gitbash to access the terminal? I tried using my password to make a new query but it wouldn't work on the workbench. I don't know how to start the SQL server in addition to not knowing how to properly change the profile for the Workbench from a previous account. A new developer, such as myself, would appreciate any insight!
So that's really simple just install the mysql community server installer using this link https://dev.mysql.com/downloads/mysql/
Make sure to select the server only in the setup during installation if you are going to be using VS code as the client to manipulate sql queries
Then once that is done copy the bin path location from the mysql file directory (which is usually in the program files on your \C: drive on your computer) to the environment variables on your computer so that you can access mysql from the command line
Once that is done you can initialise a database from the normal command line but first type mysql -u root -p to start mysql in the command line
Then download the sql tools extension on vs code and create the database that wish

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 start up MySQL workbench and connection for beginners?

I need a quick and easy way to import MS Excel databases and query them with PL/SQL for a class assignment. So far I've tried downloading MySQL Workbench and SQL Developer based on my class recommendations. MySQL Workbench looks simpler so I'm trying to learn to use that.
I'm completely lost on how to get started. Is it required for me to connect to a SQL database server before importing data? If so, how do I create one? I'm working off of my laptop and again, this is just for class so I don't need anything fancy.
I apologize for the very basic questions, as I have just started with learning databases. I researched for 2+ hours trying to figure out what to do, as my class resources aren't helpful and I must not be googling correctly as I can't find answers. If it's helpful at all, I've been successfully working with MS Access for SQL queries, so I'm comfortable with the environment. Thanks in advance.
xampp is provides a control panel for start/stop the mysql server, you can download xampp from here. After installing xampp set the enviroment variable in your system for recognizing mysql commnad in your command prompt.
you can access mysql command line in your command prompt like this,
mysql -u root

What is a mysql disconnect command line (why is it useful)?

I am running a mysql database and I connect to it just fine. My question is: whenever I connect to the database (to add new input via php) do I also have to include a disconnect command line?
I ask because my bandwidth usage is growing faster than I expected so I am happy thinking that I am getting traffic, but perhaps it is growing because I connect and do not "disconnect"?
From the mysql docs
mysql is a simple SQL shell with input line editing capabilities. It
supports interactive and noninteractive use.
The fact is that the SQL shell should not be causing major load on your box. The standard practice is to just close the shell and kill the program.
Typing Control+C causes mysql to attempt to kill the current
statement. If this cannot be done, or Control+C is typed again before
the statement is killed, mysql exits
When you exit mysql command line tool the process will end and mysql will continue doing its thing. But the answer to your question is no SQL shell should not be slowing things.
From PHP its a good idea to close the connection when you are done using it. To check out what processes are running open up mysql cmd tool and try the following to see what is connected to your mysql instance.
SHOW PROCESSLIST
if showprocesslist isnt what you were looking for give this a shot:
mysql > show status like '%onn%';
Hopefully this will give you enough information to handle the traffic load.
devzone.zend.com :
"Open connections (and similar resources) are automatically destroyed at the end of script execution. However, you should still close or free all connections, result sets and statement handles as soon as they are no longer required. This will help return resources to PHP and MySQL faster."
My advice:
It is a good practise to close a connection after doing the queries you wanted.