Connect To Sqlserver Directly From Unix Prompt
How can I connect directly to sqlserver from a Unix Prompt? I am using DataDirect in the ODBC connectivity. Is there any way whether I can connect to SQLServer from the prompt,just a select stmt will do.
For eg: if I use select * from table|sqlplus -s usernmae/password@hostname
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Call Sql Script From Unix Prompt
Is there a simple command I can use to call a sql script externally from Unix? i.e. I have a script with several sql statements within it. Kind of like a delta file which holds thousands of update. I don't want to do a full import because only 1 of the columns needs to be updated.
How To Connect Directly To Mysql Server Port (3306) Using TCP/IP Protocol
I want to develop an application in LabWindows/CVI (ANSI C developpment software for instrumentation) from which I could connect directly to mysql server port (3306) using TCP/IP protocol. This developpment environment allows me to use functions to connect, read and write to a certain port using TCP/IP protocol. I must say I'm new to using MySQL and I searched the manual without any response to my question.
Cant Connect To Mysql At Command Prompt Error
please see attached file for error. im a beginner. im following php/mysql book from site point. ive searched the forums already but couldnt find the solution. i just installed IIS on windows xp, mysql and php. im at command line and i get these (profanity removed) darn error messages. after 1 hour of re-reading chapters of the book i decided to bother you with this problem in the book it says to check mysql is running by pressing ctrl +alt + del. then in "tasks" you should see "it" running. a) there is no tab called tasks when you press ctrl + alt + del. b) what is "it" so i assume it (mysql) is running, since i dont really know because the instructions arent that clear for complete (profanity removed) silly billies like me in another thread someone said "turn off your firewall then try again" - did that, didnt work then from the command prompt i keep being told it cant connect (see screenshot)
ODBC Driver Setup - Don't Prompt On Connect
I have setup an ODBC driver for my MySQL database and use a 3rd party program to connect to it. Everytime the software connects, the ODBC driver setup screen pops up. I have to click OK on it to continue. I set the parameter "Dont prompt on connect" in the options but this has not solved the issue. The system setup is Win2K SP2, MySQL 4.0.15, MySQL ODBC driver 3.51.
Connect From Unix Mysql Server To Ms Access Server
Im wondering is it possible to connect through my mysql db (running on fedora core 4) and access the ms access tables on the ms access server? I have a connection setup the other way around using an odbc bridge, is it possible to do this the other way around enabling me to view / edit the access tables through mysql.
SQLServer 2000 Conversion
I have a web app that uses SQLServer 2000. I am switching to MySQL 4. 1.1. I have re-created all the tables but I'm running into 2 problems. 1. In SQLServer I can create a date field and as the default value I can use a macro/function to have it set the default. I have not seen an equivalent in MySQL. After doing some research I have seen only two possible solutions: a) Use timestamp. This is not suitable because it has a tendency to auto update and it's more trouble than it's worth to use a field that does this when you know it should never really change. b) Use datetime and just insert the time in. This option will require me to mess in the web app and go through and change SQL which I really would rather not have to do but will as a very last resort. I prefer the database to handle this sort of thing. So am I missing something? Or does MySQL simply not support using macros or functions as default values like SQLServer does? 2. Second problem may not be MySQL. I use Naicat and I created a varchar field with a length of 2. When I saved the table it was converted to a char of length 2. This was not cool because the two are not equivalent. I don't care how much faster char is. So my question is, is there something in MySQL that doesn't allow varchars of length < 4 or is this a Navcat thing? -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =- Stormblade (Shaolin Code Warrior) Software Developer (15+ Years Programming exp.)
Access/jet To SQLServer Or MySQL
We have developed an Access/Jet database (2000, XP & 2003 versions) that has been used by clients all around the world for several years and is extremely robust with 55 tables, 172 hard stored queries (plus about the same in VBA SQL code), 60 forms and about 18,000 lines of code. The biggest advantage with Access is that it doesn't cost the client anything for if they don't have Access already then we provide the Runtime version which makes our application extremely cost effective for the client. The most concurrent users recorded has been 23 without any problems and in 5 years we have only ever had 1 corruption when a server fell over. We now need to expand the concurrent user abilities with the most being say around 175 at the worst possible time with the objective being to allow employees in an organisation to enter a record (for eg. logging an IT Help Desk Call themselves rather then contacting the Help Desk and getting them to log the call). We know that which ever way we go there will be a massive learning curve and there WILL be an impact to the cost to the client as only some clients have MS SQL Server. Strategically we POSSIBLY may down the track be moving away from Access and to ASP.NET as the front end (or both) but at the moment we believe we have 2 options - either MS SQL Server or MySQL for the backend. I must stress that the most important factors are cost to the client, ease of self installation, size of learning curve for us and the ease of future enhancement development and support to the client.
Using MyISAM Directly
Has anybody had experience accessing MySQL tables via MyISAM library? I'm working on an application that has to have both SQL-like and DBM-like (file-level) access to the table data. I thought that using MyISAM directly would be a good idea. If anybody has any better suggestions, I am all ears. Also, I was wondering if it's possible to use Berkeley DB tools and libraries to access MySQL data files, which are set to use BDB as the storage engine. If it is, can somebody point me at some examples (except what's in the source already).
Using MyISAM Directly
Has anybody had experience accessing MySQL tables via MyISAM library? I'm working on an application that has to have both SQL-like and DBM-like (file-level) access to the table data. I thought that using MyISAM directly would be a good idea. If anybody has any better suggestions, I am all ears. Also, I was wondering if it's possible to use Berkeley DB tools and libraries to access MySQL data files, which are set to use BDB as the storage engine. If it is, can somebody point me at some examples (except what's in the source already).
Update Value Directly In The Same Query
Is it possible to update a value directly, adding text to it, without getting it first, adding the text in php and then do the update. for example: value in field users: ",45," and then adding ,34, to the field directly by doing something like: update table set users='users,34,' so the value in the field afterwards will be ",45,,34,"?
Joining Tables Which Aren't Directly Related
I'm struggling to get my head round a SQL query and wonder if you might be able to help (I'm using MySQL version 4.1.20-1). I have three tables: accounts, items and invoices. CREATE TABLE accounts ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, ... PRIMARY KEY (id) ) ENGINE = InnoDB; CREATE TABLE items ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, accounts_id INT UNSIGNED, ... PRIMARY KEY (id), FOREIGN KEY (accounts_id) REFERENCES accounts (id) ON DELETE SET NULL ) ENGINE = InnoDB; CREATE TABLE invoices ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, items_id INT UNSIGNED, ... PRIMARY KEY (id), FOREIGN KEY (items_id) REFERENCES items (id) ON DELETE CASCADE ) ENGINE = InnoDB; Each account can have multiple items and each item can have multiple invoices. Hope you're with me so far? So here's the question. If I have an account ID, how do I get a list of invoice IDs for that account when accounts and invoices aren't directly related?
Associative Table Or A Directly Foreign Key
I am working with hibernate and i want to map my Objects to tables structre. There is two ways to map relation: 1. with associative table 2. directly foreign key (i mean without associative table) Can you please explain what are the advantages for each way?
Inserting Small Image Directly Into Database
How do you insert an image into a table directly using something like data studio? I have tried googling it and it seems all the examples are using a language to do it for you. The images are between 2-4k and the table is just an int column followed by a blob column. I just thought the statement would go like INSERT INTO sometable VALUES (1,'image.jpg'); The web suggests uploading and downloading in PHP (which im using) but im building the data first using data studio then just displaying the table information using PHP. Before i go into displaying the information on the page i just wanted to make sure the insert query is correct.
How To Insert Images Directly Into Mysql Table
Im working on a page for photographer. And he wants some amount of photos to have there and change it whenever he would like to. I thought i put all the photos in mysql db and i would pull it out to webpage using variables. But Im stuck already in the first step - STORING THOSE IMAGES INSIDE A TABLE OF DB. I read about BLOB and avr_row_length and max_rows, but nothing is working. The image is stored in many rows and the output is just strange symbols. I also read those long, hard-mind taking scripts how to upload image using php. But i dont want to slowstep through php, uploading file etc, I just want something like: LOAD DATA INFILE 'image.img' into table tbl_name; and then using php on my page to display it.
MySQL Administrator Backup Directly To Local Database
In MySQL administrator is there a way to backup directly to my local database from a remote host. I would ideally have this done automatically once a day. I like to test locally and don't want to have to restore the database locally each time a backing from the remote site is done.
Cmd 'Prompt'
I've recently had to re-build my dev box and as part of the re-build I've re-installed v4.1 (for Windows). I'd previously had v4.1 BETA installed and in that I had a my.ini file setting that customized the cmd prompt to show the current database and user. The trouble is that in the production version of 4.1 the same ini file setting has no effect. I'm using an ini file setting of [mysql] prompt=u@h-d> This definately worked for me in 4.1 BETA and it's what the MySQL documentation state is the way to do it. Once logged in I can manually make the setting by doing: mysql> prompt u@h-d>
How To Log Into The Mysql Through MS DOS Prompt
I had tried to login through the MS Dos Prompt mysql console mysql -u root --password b Enter password: * ERROR 1049 (42000): Unknown database 'b' The above is the output What is the correct way to login.
USE Database Prompt
How do I know what database I am 'using' ? I launch mysql from the command line. Type 'show databases', then pick a database to use by typing 'use databasename'. I am now using that database but have no visual cue. How do I include the username, database name, etc in the 'mysql>' prompt? Note, I can customize the command prompt on linux to include user, host, directory, etc.. so I always know who I am and where I am.
USE Database Prompt
MySQL v 3.23.56 for pc-linux-gnu on i686 How do I know what database I am 'using' ? I launch mysql from the command line. Type 'show databases', then pick a database to use by typing 'use databasename'. I am now using that database but have no visual cue. How do I include the username, database name, etc in the 'mysql>' prompt? Note, I can customize the command prompt on linux to include user, host, directory, etc.. Code:
Cannot Log On Via Command Prompt.
Our entertainment division uses MySQL as the database of choice for their various websites. They are not command-line-type people (who would want to that? i mean I like command line OK, but I'm weird). Using their PHP Admin program, they administer the databases quite efficiently. All of us can log on fine via the PHP interface. Additionally, I've installed the MySQL ODBC in a few places and it works fine. We all use the username root and password abc. No problems. My problem is that I can't access the MySQL server via the command prompt. I do this: CODEc:mysqlinmysql -u root -p
USE Database Prompt
MySQL v 3.23.56 for pc-linux-gnu on i686 How do I know what database I am 'using' ? I launch mysql from the command line. Type 'show databases', then pick a database to use by typing 'use databasename'. I am now using that database but have no visual cue. How do I include the username, database name, etc in the 'mysql>' prompt? Note, I can customize the command prompt on linux to include user, host, directory, etc.. so I always know who I am and where I am.
Prompt Message
how to make alert message? eg: if (false) { <- alert message -> } else { <- something -> } what coding to prompt alert message to user?
No Password Prompt
I'm trying to install mySQL on my WIN98 machine (I ran the setup.exe file), and am never prompted for a password when I run the configuration wizard. When I try to then run the command window, I'm asked for the password. Can I change some config file or ini file? I'm selecting either Detailed or Standard Configuration, and don't ever get the prompt for password. The checkbox for "Install as windows service" is disabled, so I can't check it.
Login Prompt
I have a script that uses MySQL and for some reason the first time it loads per session I get the prompt box to login to MySQL? It seems to be session based but is just weird
Prompt A User
Is there anyway in MySql to prompt a user to enter input and have it populate another table?
Login Prompt
I am having a hard time tracking to when it started. But basically in IE when I attempt to load a script for what it seems like the first time per session I get a login prompt open like what i see when I login in to MySQL, this script uses MySQL heavily.
Command Prompt Shortcut
Each time I call up Command Prompt, I go through the long rigmarole till eventually I arrive at the MySql database. Is there a way to make shortcuts for Command Prompt so I could click on the shortcut and arrive straight at the database,
Online MySQL Prompt
My host provides me with its own MySQL prompt, called phpMyAdmin (in cPanel). It is quite hard to use, because it keeps on jumping to different pages after each prompt and incorrectly names my databases as "username_whateverINameIt". Is there any way to use a regular MySQL prompt (DOS style) as is directed from my book?
Paste Into Command Prompt
I've heard it said that you can copy and paste into mysql on Window's command prompt. The normal way - Ctl-V - doesn't work for me. But once, when I had some documents resting on the keyboard, something actually did go from the Clipboard onto the command prompt screen.
Input Prompt Or Mysql
How do I prompt a user for input using mysql. I want the user to be able to input a a person's name which will then cause a query to run giving the required details. I was given this example to work from (from an oracle handbook) but it doesn't seem to work in mysql:- select empno from emp where mgr = &Mgr_no;
Pre-empting The Password Prompt For Mysqldump
I would like to backup a mysql database automatically, say once a day. I understand that cron may be used to schedule such a task, but I first need to create a shell script which creates the database backup. (I am new to shell scripting, so please bare with me!) My first attempt was this: # # Creates a backup of the freelance database # mysqldump -h localhost -u root -p freelance > fldb_backup.sql; When I run the script from the command line, I am prompted for my password. This would be no good if the script was scheduled, so I tried altering the command to this form: mysqldump -h localhost -u root -p mypassword freelance > fldb_backup.sql; When run, it still prompts for my password when. How can I get around this problem?
Accessing Mysql From Command Prompt
The path to my mysql installation is "C:Program Filesxamppmysqlin". I want to run myisamchk - to do this I think I have to access it via the command prompt. A stupid question - I kmow - but how do I get to the directory in a DOS window??
MySQL Command Line Prompt
In DOS mode, we can use for example dir/w-p to break the whole page to sub-page. In MySQL prompt window, when I type "show variables", it blooms about 190 rows, but I can't scroll BACK to first 1-50 rows, by resizing the prompt windows it won't help. So, I think is there any additional keys for pause the page like DOS mode?
Using TCP/IP Instead Of Unix Sockets
An associate has asked me to take a look a problem he's having with starting mysql. I thought I'd give it a shot to learn some more about mySQL before having him turn it over to someone more knowledgeable than I. But I have to ask here first. Attempting to connect to the database via mysqladmin or mysql results in the error (paraphrased) "Cannot connect to local database using socket "/var/lib/mysql/mysql.sock". That is the path to the socked specifiet in both mysqld and client sections of the my.cnf. mysqladmin -h `hostname` version shows that the Connection is via TCP/IP rather than Unix Sockets. Running on Redhat Linux AE 3 (I think) /var/lib/mysql is world-writable-readable, but it is not owned by user mysql (my next attempt to fix this) /var/lib/mysql/mysql.sock is 777. My question: What would be causing mysqld to be using TCP rather than Unix sockets? I've checked permissions, verified settings in my.cnf (which is very sparse... other entries are for logging), confirmed mysqld is running and accessible via TCP/IP.
Not Seeing MySQL Prompt In Emacs Sql-mode On Windows...
I've been using emacs sql-mode for some time now (with MySQL) and love it. I've used it on both Windows and FreeBSD (sadly I do most of my work on Windows though) and have noticed that the output the prompt and output on the Windows machine isn't displayed, but is displayed on the FreeBSD machine......
Problems Executing .sql File From Command Prompt
I am having problems executing a .sql batch file from the mysql command prompt. I can run this file through SQLYog and i have no errors/problems but if i try and run the batch file through the windows command prompt (after connecting to the mysql database) i get a problem as soon as i try to change the delimiter back to ; Has anyone else had problems with this?
Covert Unix Timestamp
Been trying to use DATE_FORMAT on a timestamp in my table. However, just noticed that it's a UNIX timestamp, and not a datetime() timestamp. Is there a function that convert unix timestamps in a sql statement? Trying to get the format "dd/mm/yyyy"
Unix Date Problems
1) I was investigating the unix_timestamp routine in mysql (version 3.23.46-nt) and for some reason the unix epoch (1-1-1970) was returned with a value of -3600. Then, as you can see, it suddenly corrected itself. I can't replicate this error, but it caused me to shudder. Attached is the output from the command line client. 2) The function from_unixtime(n) wraps on my server after 2^31 seconds. e.g. select from_unixtime(2147483648) returns "1900-01-00 00:00:00". I suspect this is caused by the underlying time_t size that mysql was compiled with. Is this so? Are any versions of mysql compiled with a larger time_t? +---------------------------+ | from_unixtime(2147483648) | +---------------------------+ | 1900-01-00 00:00:00 | +---------------------------+ 1 row in set (0.00 sec) mysql> select unix_timestamp(); +------------------+ | u................................
Unix Socket Vs TCP Mode
Our mysql database always run smoothness, but there have a strange question always happy. We retrieve content using unix socket mode is always Correct, using TCP mode sometime will meet no return Error. What's wrong with TCP mode? For example, We need to retrieve content from table Tab_Memo, the condition with ‘large’ is over 20KB, with ‘small’ is about ‘5KB’. Using unix socket mode: ---------------------------------- mysql -u root -p password 1、select * from Tab_Memo where name = ‘large’; // The result is Correct. 2、select * from Tab_Memo where name = ‘small’; //The result is Correct. Using unix socket mode ---------------------------------- 1、select * from Tab_Memo where name = ‘large’; // NO result return. 2、select * from Tab_Memo where name = ‘small’; //The result is Correct.
Grouping By Day With Unix Timestamp
Times in my database are stored as unix timestamps, and I need to find out how many sales per day. How do I use mysql to group by day when working with unix timestamps? I thought i could use something like select yea(timestamp) .... but this returns null.
MySQL Via Unix Sockets
I'm using java+JDBC connector. Where do I need to set up something to work with /var/lib/mysql/mysql.sock
Two Versions Of Mysql On Same Unix Box
I have mysql 3.23.58 version running on my unix box. I installed a new application on it which need mysql version > 4.0 so I thought of having two mysql versions running on the same unix box. I have first installation in /usr/local/mysql and I untared the new version in /var/local/mysql-standard-4.1.18-pc-linux-gnu-i686-glibc23. I am following instructions given in http://dev.mysql.com/doc/refman/4.1/en/multiple-servers.html I also created a empty file and named it as mysql.sock.new and stored it in /var/local. When I try to start this new version from /var/local/mysql-standard-4.1.18-pc-linux-gnu-i686-glibc23 using ./bin/mysqld_safe --datadir=/var/local/mysql-standard-4.1.18-pc-linux-gnu-i686-glibc23/data & it says "A mysqld process already exists". Please tell me where I am going wrong and how to configure it properly?
|