Creating a new database, and a password for it


  • | 970 points

    Sorry for that, but I'm just new to creating MySQL databases locally..
    Please, give step-by-step hint how to create a MySQL base using terminal or PHPMyAdmin..
    Sorry for such questions, before I created databases on a real server by PHPMyAdmin, and it is quite simple there.
    In laragon, when trying to create a database in terminal by the command "mysqladmin -u root create 'homestead" , I got this:

    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: NO)'

    Please, explain how to set a password for a new database?
    And where may I find the ".env" file ?
    Thank you so much!


  • | 16118 points

    @dizer I tried your command it worked for me.

    0_1622589893135_upload-c49ddc99-4b42-4f86-90c3-084bb2cdf049

    1. Make sure Laragon is started
    2. type the command, without the ditto mysqladmin -u root create homestead
    3. If this doesn't work, check your version of mysqladmin --version matches Laragon's 5.7.33 ships with Laragon 5.0
    4. You normally copy the .env.example in your project's root directory to create the .env file

  • | 970 points

    Excuse me again, but I suppose the main problem is as follows:
    When I just install Laragon, I can create a database by command in terminal, but after I install PHPMyAdmin, I have to change a root pasword to log in to it.. And since that moment I cannot create database by terminal, I receive the same error report:
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: NO)'

    Please, if anyone know, how to set or enter the password in terminal while creating a database?

    And where can I find "MySQL username"? Is it "root"?


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.