#Mysql -u root error

97 messages · Page 1 of 1 (latest)

polar harness
#

Hello. I have been following a tutorial in laravel and now we're on to creating a database through terminal but It seems like the mysql -u root command doesn't work on my terminal. I have also included already the C:\xampp\mysql\bin PATH in env. Thanks in advance

clear snow
#

I think that MySQL did not install in your platform

#

didn't you use xampp for server program?

polar harness
#

Yes, sir. Im using xampp

clear snow
#

ah, so why do use this command?

patent oar
#

Your first screenshot is in Powershell

#

the second is in CMD

polar harness
#

My worry here is that I can create the database through localhost/phpmyadmin but I'm worried that I might have a problem when we go to the "Migration" stuff (tho I dont know about it yet)

polar harness
polar harness
#

This one on same terminal as first one

clear snow
#

excute your command in powershell

polar harness
#

I'm kind of just trying to follow everything he does hehe

polar harness
patent oar
#

mysqladmin.exe -u root

#

you're on windows

#

he's on linux I imagine

polar harness
#

This works

patent oar
#

Yeah, you're following a linux tutorial 😄

polar harness
#

But the result is kinda too many than what he got

#

Let me show it to you to confirm if it should be the expected result

#

Thank you so muuuuch

patent oar
#

Your best bet, is look at the Laravel Sail guide, as it uses Docker and gives you a Linux environment.

Windows has historically not played as nicely

polar harness
#

Im not gonna send all anymore

#

It gave me tons of this

#

Is this the expected result I should get?

#

The tutorial i'm following only got this

#

Still can't create database 😭

patent oar
#

you're not in mysqladmin yet#

#

Check in Xampp to make sure that the mysql server is running

clear snow
#

did you start mysql server?

#

in xampp?

polar harness
#

Yes i did, sirs

clear snow
#

can you connect mysql by using navicat?

polar harness
#

What's weird is

#

He was on this directory when he used the command

#

Then became here when after he entered it

clear snow
patent oar
#

Is it just me, or does that look like a really old version of Xampp (granted I've not touched it in about 10 years)

polar harness
polar harness
polar harness
clear snow
#

yeah he used MariaDB not MySQL

patent oar
#

In CMD, navigate to the directory you installed mysql in (probably c:\Program Files or similar)

polar harness
#

This one?

patent oar
#

yep

#

so in the command prompt type:

cd c:\xampp\mysql\bin

#

now type

polar harness
#

On it now sir

patent oar
#

mysql -u root -p

#

does that now work?

polar harness
#

HOOO it did!

patent oar
#

Wahey

polar harness
#

Should I do the same on terminal?

#

I mean powershell of vscode

patent oar
#

If that's what you're going to be working in

polar harness
#

Yes thats where I'm working in

patent oar
#

you should only need this for the first bit fortunately 🙂

#

once you've got the databse/user created etc, you'll be using migrations etc

polar harness
#

So everytime I have to migrate i will redirect to this first?

patent oar
#

no

polar harness
patent oar
#

when you migrate, you'll use artisan

polar harness
#

I see I see

patent oar
#

from vscode, in the base of your application

clear snow
polar harness
#

I see I see. So I actually only needed to do this for creating the database on terminal like how he did?

#

I'm not getting the "Query OK. 1 row affected (0.001 sec) yet tho

#

😭

#

Still stuck on this

#

Database still not on phpmyadmin yet too

clear snow
#

first create your DB

#

and then migrate

polar harness
#

Yes sir. But tbh, I'm only following this to be able to create DB on terminal

#

But I can just create it through phpmyadmin

#

Do I really still need to do this? (be able to create DB through terminal)

#

Will it be necessary for me in the long-run?

#

Tried it again and still stuck here 😭

#

Nvm

#

I just forgot the semicolon