How to create a connection with MySQL Admin? - mysql

I am extremly new with databases. I have only created one, and that was in SQLite on android. I downloaded MySQL Admin for linux (Ubuntu) and downloaded and installed Admin. Now I want to create a database, but I jave know idea what I'm doing. I created a connection via the drop down menu option 'Open Connection Editor', and I keep getting a 'MySQL Error Nr. 2005' error. Do I have to do something command line wise first to set up the database?
Any help is appreciated.
Aedon

MySQL is different to SQLite in that you need to have some server software running the whole time managing the database. It's that server software that you connect a MySQL client to.
You need to grab yourself a copy of MySQL Server then I'd recommend this tutorial
Good luck!

If you are using Ubuntu you can install MySQL Server easily with this command:
sudo apt-get install mysql-server
and then I suggest you to download MySQL Workbench, it's a GUI Tool where you can do almost everything with MySQL databases (create,drop,alter, modeling, administer the service).
Then, you can create a connection with mysql workbench or mysql admin (or another client) and do your stuff. If you installed the server in your PC then the parameter are something like this:
host = localhost
user = root
password = (the password you specified in the installation)

Related

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

How did mysql workbench get my old database?

I created database using mysql from phpmyadmin for some practice purposes. Now I've just downloaded and set up mysql workbench and right after I saw my old database which I created in phpmyadmin and that makes me wonder how did workbench get it?
Both phpMyAdmin and MySQL Workbench are administration/client tools. It is used to connect MySQL Service running on your machine / remote machine called server. (usually on port 3306).
When you create databases or store data which is stored under a folder represented as datadir which is owned by the MySQL service.
how did workbench get it?
Database is managed by MySQL Service, like a phpMyAdmin, Workbench also another client, connecting to same MySQL Service.
Similarly, you can use any other MySQL Client to connect with the same MySQL service running on your machine.
Additionally, you can refer my blog to understand more about MySQL Architecture.

Can I connect to mysql server with only mysql client installed?

This is very novice question I am very new to working with Databases, primarily an user of R, also comfortable Bash Unix Shell. I have a MySQL server 5.7 installed on windows 10 laptop and have been using Workbench for accessing or populating databases.
I want to have a good command of in-database analytics and had a few broad questions.
Its easy to access MySQL database on my laptop from R on my laptop that was simple. Also if I go to windows command line and type mysql -u -root -p from the directory MySQL/MySQL Server 5.7/bin in can start typing SQL commands at mysql prompt.
My question is, regarding accessing my MySQL databases in my laptop or any other mysql server. From a remote Linux session on a VM, or after starting R in that Linux session. I linux can I install a mysql client alone on a Linux VM and access MySQL databases or do I have to install MySQL server as well.
My premonition was that I wouldn't have to install the server but I was experimenting in Windows Linux Subsystem(WLS) (which is a source of confusion itself since WLS is a new thing and I didn't want to generalize what I learn from experimenting in WLS to working from a remote Linux machine.
Then there is another question of working off a Linux in Virtual Box installed on my windows.
To simplify my question I would like at least know be certain about does one need to install mysql server to and have it running to access any mysql database on another machine or will it suffice to have a mysql client installed?
Your input will be greatly appreciated, as I have been only successful in trying to use my WLS and read several post/blogs I would like to be clear about how MySQL works before continuing my experiments.
Ideally I would like to query data from any bash shell that I can find or any R session.
Thanks
No, you do not need to install mysql server on a computer to be able to access another mysql server remotely. The client will suffice.

How to create a local database for MYSQL workbench?

Is it possible to create a local database on my home-computer for MYSQL workbench?
This server is only for my own use. Not to the outside community.
Download XAMPP on your machine and install it. (Windows)
After successful installation, you will be able to see an icon on your toolbar.
Click on it and start Apache, MySQL and if anything you need.
Open browser, type : localhost/phpmyadmmin
This will give you an GUI to manage databases locally on your machine. XAMPP basically provides you local server.
If this is what you are looking for, after creating a database in MySQL from your local machine, then that you could access the database through MySQL workbench as a local instance. It asks you to authenticate based on your MySQL conf though. Just the normal way!
You can download WAMP (Apache, Mysql, PHP) server on Windows.
Then add new connection in workbench.
host:127.0.0.1
username:root
password:<Empty>

MySql workbench not responding w local server

I have been using MySql Workbench to connect to a local MySql server and to remote MySql Servers. The last couple of days the Workbench freezes when I connect to the local version. It still works for the remote servers.
I am using workbench 6.3.4 and then tried 6.2.5 just to see if it is a version issue.
I also can access the local MySql instance using HeidiSQL.
Any recommendations on what to look for?
Update
The advice to recreate the connection solved the issue. I just created a new one and it works fine.
A couple of things you can try:
Try restarting the sql server (remember, workbench is just a utility for accessing a db, it does not host the database for you)
See if you can access mysql on the command prompt / terminal, the command for mac & windows
(once you navigate to the mysql folder, try the command:)
mysql -u root
(if you have a password-protected account, the command will be
mysql -u someuser -p
If the above doesn't work, mysql is either offline or denying you access (depending on response), and you'll need to setup the server / assign privileges.
If all else fails, it may help to try another version of SQL / Workbench (for a easy-to-use sql sever setup, I'd recommend WAMP or MAMP, assuming you want a HTTP server bundled with it)
Additionally, it may help to recreate the local connection in workbench (of if your getting regular crashes, reinstall & update workbench). Good luck with it.