How to use aspnet_regsql.exe - sql-server-2008

I'm having problems Creating Users in a Silverlight Business Application that uses the Local IIS Web Server.
If I use the Visual Studio Development Server I have no problems, but once I check "Use Local IIS Web Server" in the properties page and run the application, whenever I try to create a new user using "login->Register now" I get an "Unable to connect to SQL Server" error.
I found a similar problem as mine and the solution was to use aspnet_regsql in the command prompt.
If I have to use this tool, then I don't know how to use it:
aspnet_regsql.exe -S DBServerName -U DBLogin -P DBPassword -A all -d DBName
What should I enter in these parameters:
DBServerName: I guess it's ".\sqlexpress"
DBLogin and DBPassword: Kind of a login and password for the database?
DBName: If I'm not using any particular database, then what?
Please, what should I do here?

Navigate to the wizard(C:\Windows\Microsoft.NET\Framework[framework version]\aspnet_regsql) and launch it , you will be able to see a form appear and you can enter details here rather than using the command prompt.
Also within VS , from top menu select WEBSITE -> ASP.Net Configuration you should be able to see all your user and role details (you can tst the connectivity as this will pull of data based on your web.config/app.config settings)

Related

How do I get the CloudBees Database password

I want to access my CloudBees managed Database (MySQL) with a password from my app and client - how to I get it?
First, you will need to install the command line tools
Run
bees db:info -p youraccount/dbname
and this will show all the details you need.
(-p means to show the password on the terminal, it won't by default).
If you use "bees app:bind" - or a clickstart setup your DB binding for you - your app should already be wired up to connect to the database when it runs in cloudbees (you shouldn't need to ever see the password in this case).

Cannot see my database (schema) in MySQL Workbench

I recently installed mysql5.5 to my Windows 7 (x64) machine. The first problem was I couldn't enter the cmd client with mysql -u root -pmypass. The cmd opens, yields an error for like 0.5s and closes. Than I created another user account with all privileges, it worked and I created a database. But now I want to export that database from MySQL Workbench but I cannot see that in the "select a schema" option. I tried "new connection" and "new server instance" none worked.
Any suggestions?
Thanks in advance..
For the command line use WB too. In the list of connections you can right click for the context menu, which also offers to open a CLI window. In general, when you work with the CLI first open a normal CLI window (Start Menu -> Programs -> Accessories) and then try the mysql -u -p command. This way the CLI window won't close immediately and you can see what error message came out.
For WB: if you don't see a schema you know is there then probably the user you used to connect has no permissions to see it. So for tests try connecting as root and see if your schema is there. Import and Export of db objects (including entire schemas) is available in the admin section, not in the SQL IDE (where you found "Edit Table Data" etc.).

Authenticate as a specific user in MySQL

I'm a Brand new User to MySQL DB, have installed the WAMPSERVER and I'm using MySQL through the MySQL console.
Query_1: Every time that I log in, it directly asks me for the password of root. However, i want to log in as a different user.
Query_2: If at all i do login as root, i want to switch user without closing the console.
How can I do this?
Thank you.
You can specify your username and password like this:
shell> mysql --user=user_name --password=your_password db_name
As far as I know, there is no way to change user after login without restarting the client.
I don't think its possible to switch users while in the console itself. You have to login with the different user instead.
Logging in use this command
mysql -u username -p
Then it will prompt for the password.
It is not possible to switch users in the MySQL console using WAMP. You must use SQL through the windows command line to switch users.
Steps (win 8):
1) Start
2) Type: 'command prompt'
3) Type: 'cd /'
4) Navigate to where WAMP bin is located, my location is: C:\wamp\bin\mysql\mysql5.6.17\bin by typing: 'CD wamp\bin\mysql\mysql5.6.17\bin'
5) run SQL under new user by typing 'mysql -u (username you want to use) -p (database you want to connect to)'
You will now be logged in as a new user.
If you attempt to login without specifying a user-name, MySQL will assume "root". In most cases you don't switch the user, but give a single user all the required rights;, for example to access multiple databases. If that is not possible for you, you can use two MySQL connections with two different users simultaneously.
The MySQL console provided in the wampserver admin panel, once a password is set, will prompt you for the root user's password before you can do anything. In order to log-in as a different user you need to log-in from the command-line. In order to this however, you'll need to add the file pathway to your installation of MySQL's bin folder to your user environment pathway so that your system will be able to access MySQL from the command line. To do this on windows open up file explorer, click on your C drive, open the wamp folder, open bin folder, open MySQL folder, open the MySQL folder with your installation version, open the bin folder you find there. In the file pathway bar of file explorer click on the folder icon to the left to generate the pathway to this bin folder, copy the pathway. Next open up control panel, in the search bar type the string environment variables, select edit user environment... you don't want to mess with the system environment, on the screen that appears choose the PATH variable- if it's not there then add it. Finally paste in the file pathway to MySQL's bin folder. Open up a command prompt and type mysql -u uswername -p hit return and then you'll be prompted for that user's password. Assuming of course you've made another user already.
As far as I know, once logged in as the root or any other user, the only way to switch is to exit mysql and then enter again as a different user.

MySQL command line won't open?

I just installed the latest version of MySQL. Until Now I had it on Windows XP but I wanted to install this on another computer with Windows 7.
Even after configuring everything correctly, the MySQL client won't show up in the Start Folder. So I went to the bin folder of MySQL and tried opening mysql.exe but it would immediately close down.
I then tried opening mysql.exe in cmd & this is what I get
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql
ERROR 1045 (28000): Access denied for user 'ODBC'#'localhost' (using password: N
O)
Any Ideas how I can get this to work?
Provide username (root)
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql -uroot
Default passsword is blank, but if you set it, you will need to provde password as well
I don't recall where I first read it, but when facing this problem before, I found that I had to manually turn on a service:
Windows key+R and type Run and hit "enter"
Type "services.msc", hit "OK"
Find "MySQL56", right-click and choose "Start"
You should now be able to log in with no trouble
That's the solution that worked for me; hopefully it helps others out there.
What #Herschel said is right if you follow his steps 1-4 then try to log in with your password in command line you'll have no trouble.
You can also make this run automatically as a service, something which you need when running it on a server.
Open Run
Type "services.msc" click ok
Find the MySQL service
Right-click properties then go down to startup type:
Change it to automatic
I followed these steps and it worked for me:
1. Open Command prompt in admin and go to the location of Mysql bin folder and type -
C:\ProgramFile\mysql\bin>mysql -u root -p <password>
2. Then the prompt asks for the password. This is the password or the root user which
you had set during installation of mysql.
3. Type the password and you will login in to mysql.
4. Also make sure your mysql service is running in the backend by going to the
windows service panel and check whether the mysql service is running.
Heyoo Heyoo. So as of today 19th March 2022 I had this same issue but imma show you how I solved it. My specs before we start:
MySql Version: 8.0
OS: Windows 10
OS Build: 19044.1586
Alright, I'm fairly new to SQL, was following along with a tutorial but when it got to the point of opening the client command line it wouldn't open, it just popped up and closed back; didn't even ask for a password. After watching several tutorials (which were very unhelpful) I noticed from those tutorials that the solution they proffered was to "Active the MYSQL80 service", but that was unhelpful to me because I couldn't see that service in the services menu.
So I decided to go back to the "MySql Installer -Community" App (I installed the community version of SQL)
After the installer had opened up I clicked on the "Reconfigure" action for MySQL Server
It opened the configuration window for the SQL Server and I followed the configuration process to set up the server (turns out I didn't initially set it up when I installed MySQL 😅😅). After the configuration process was done I went back to the services menu to see if the "MYSQL80" service was there... and it was, I checked to see if it was running; following the instructions from this tutorial. After making sure the service was running I went back to the client command line, it finally opened up, allowed me to input my password, and it's working properly!!

Unexpected error message from aspnet_regsql

I am trying to use the aspnet___regsql utility to install all the membership tables in a database on my local SQL Express 2008 instance. I can connect without problems in Management Studio, but when I try to list the databases in the aspnet_regsql interface i get an error message saying:
Failed to query a list of database names from the SQL Server.
Invalid object name 'sysdatabases'
What am I doing wrong? How do I fix this?
(Please tell me there's a smoother way than reinstalling the thing... :P)
I have solved the problem by bypassing the graphic interface and performing the same action directly in the command prompt, with flags specifying all options. They should look like this:
Connect using SQL Authentication
C:\>Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe -S myHostingServer -A all -d myDatabase -U myUserID -P myPassword
Connect using Windows Authentication
C:\>Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe -S myHostingServer -A all -d myDatabase -E
The difference is at the end of the lines, where SQL Auth. has -U myUsername -P myPassword while Windows Auth. has -E (which flags for Trusted Connection).
If you want to use the graphical interface, you need to make sure the user you are logged in as has the default db in SQL set to 'master' so it can connect directly to the sysdatabases table.
Ensure that in SQL Server Configuration Manager -> SQL Server Network Configuration -> Protocols for YOUR_SQL_SERVER_INSTANCE_NAME is enabled TCP/IP. NB. for applying this change need to restart YOUR_SQL_SERVER_INSTANCE_NAME
By default on Vista the current user on the machine is not a member of SysAdmin on SQL Server 2005/2008.
So here is the trick.
1-Open Sql Server Surface Area Configuration tool from C:\Program Files\Microsoft SQL Server 2005/2008.
2-When the screen pops up click on Add New Administrator.
-on top right make sure that User to provision=Username of the pc
-on your left (Available Privileges) select Member of SQL Server SysAdmin and click on the right arrow (>)
-click ok and you should be ready to go.
My name is Talley Ouro,Developer in Raleigh,NC
Blog: http://talleyblogs.blogspot.com/
Email:johnstalley#live.com
This issue is generally caused by leaving "Server" to be your machine name instead of the name of your SQL server instance. It's tricky to figure out because they autofill the text box to your machine name, which is needed but incomplete. This may lead you to think "Server" refers to the computer itself when they really mean SQL server instance. If you are connecting to your local machine you can generally append to their entry with the name of your SQL instance and everything will work as intended
IE LOCALHOST must become LOCALHOST\SQLEXPRESS or whatever you name your box\sqlserver